diff options
author | Marcelo Lira <marcelo.lira@openbossa.org> | 2010-10-15 17:17:35 -0300 |
---|---|---|
committer | Hugo Parente Lima <hugo.pl@gmail.com> | 2012-03-08 16:07:21 -0300 |
commit | 894d7c725bc103919d38a6a491852e8cfc255d7d (patch) | |
tree | 3248ee2f00c4d8e566f695fc2a5402bfd4488cd0 /tests/libsample/listuser.h | |
parent | dc18b27491b45577fe2868382f0f645a4127387b (diff) |
Added test for overload decisor handling container dependencies.
Explaining with an example. Consider a function called "function" with
two signatures accepting a list of Point and a list of PointF,
respectively. Consider also that Point is implicitly convertible to
PointF.
void function(list<Point>&)
void function(list<PointF>&)
A list of Point should be checked before a list of PointF.
Reviewed by Hugo Parente <hugo.lima@openbossa.org>
Reviewed by Luciano Wolf <luciano.wolf@openbossa.org>
Diffstat (limited to 'tests/libsample/listuser.h')
-rw-r--r-- | tests/libsample/listuser.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/libsample/listuser.h b/tests/libsample/listuser.h index bbb555be7..eb5d4b613 100644 --- a/tests/libsample/listuser.h +++ b/tests/libsample/listuser.h @@ -26,6 +26,7 @@ #include <list> #include "complex.h" #include "point.h" +#include "pointf.h" #include "libsamplemacros.h" @@ -34,6 +35,11 @@ class LIBSAMPLE_API ListUser public: typedef std::list<Point*> PointList; + enum ListOfSomething { + ListOfPoint, + ListOfPointF + }; + ListUser() {} ListUser(const ListUser& other) : m_lst(other.m_lst) {} virtual ~ListUser() {} @@ -46,6 +52,9 @@ public: double sumList(std::list<int> vallist); double sumList(std::list<double> vallist); + static ListOfSomething listOfPoints(const std::list<Point>& pointlist); + static ListOfSomething listOfPoints(const std::list<PointF>& pointlist); + static void multiplyPointList(PointList& points, double multiplier); inline void setList(std::list<int> lst) { m_lst = lst; } |