diff --git a/src/libs/utils/function.cpp b/src/libs/utils/function.cpp index 45f02f776dfaf8300323f25ed4d1626e4c5b9f5d..68370976d873823bec3f5ad9202203af215ac406 100644 --- a/src/libs/utils/function.cpp +++ b/src/libs/utils/function.cpp @@ -41,7 +41,7 @@ void functionUser(Utils::function<int()> generator, Utils::function<void(int)> c struct GenFunctor { - int operator()() const { return 29; } + int operator()() { return 29; } }; struct ConsumerFunctor @@ -49,13 +49,6 @@ struct ConsumerFunctor void operator()(int) {} }; -struct ConsumerFunctor2 -{ - ConsumerFunctor2() : i(0) { } - int i; - void operator()(int j) { i = j; } -}; - int generatorF() { return 42; @@ -71,9 +64,6 @@ void test() { functionUser(GenFunctor(), ConsumerFunctor()); functionUser(&generatorF, &consumerF); - ConsumerFunctor2 f2; - GenFunctor g2; - functionUser(Utils::cref(g2), Utils::ref(f2)); } } // end namespace diff --git a/src/libs/utils/function.h b/src/libs/utils/function.h index 52938f385e406dd1ee45a5867f9f8067f4e2a3d6..d6dbc2f99998b357851e5118676700db33543bda 100644 --- a/src/libs/utils/function.h +++ b/src/libs/utils/function.h @@ -39,9 +39,9 @@ # ifdef __GNUC__ # include <tr1/functional> # endif -namespace Utils { using std::tr1::function; using std::tr1::ref; using std::tr1::cref; } +namespace Utils { using std::tr1::function; } #else -namespace Utils { using std::function; using std::ref; using std::cref; } +namespace Utils { using std::function; } #endif #endif // QTC_FUNCTION_H