forked from qt-creator/qt-creator
Revert "utils/function: expose also ref and cref"
Visual studio 9.0 (2008) and 2012 work, but 2010 breaks :( This reverts commit 0b90d7930804beb2f0a16e97b75a6e8fd9a2b835 Change-Id: I3c9bea05ac07ca8cdeb5be5fb89234675dd72061 Reviewed-by: Fawzi Mohamed <fawzi.mohamed@digia.com>
This commit is contained in:
@@ -41,7 +41,7 @@ void functionUser(Utils::function<int()> generator, Utils::function<void(int)> c
|
|||||||
|
|
||||||
struct GenFunctor
|
struct GenFunctor
|
||||||
{
|
{
|
||||||
int operator()() const { return 29; }
|
int operator()() { return 29; }
|
||||||
};
|
};
|
||||||
|
|
||||||
struct ConsumerFunctor
|
struct ConsumerFunctor
|
||||||
@@ -49,13 +49,6 @@ struct ConsumerFunctor
|
|||||||
void operator()(int) {}
|
void operator()(int) {}
|
||||||
};
|
};
|
||||||
|
|
||||||
struct ConsumerFunctor2
|
|
||||||
{
|
|
||||||
ConsumerFunctor2() : i(0) { }
|
|
||||||
int i;
|
|
||||||
void operator()(int j) { i = j; }
|
|
||||||
};
|
|
||||||
|
|
||||||
int generatorF()
|
int generatorF()
|
||||||
{
|
{
|
||||||
return 42;
|
return 42;
|
||||||
@@ -71,9 +64,6 @@ void test()
|
|||||||
{
|
{
|
||||||
functionUser(GenFunctor(), ConsumerFunctor());
|
functionUser(GenFunctor(), ConsumerFunctor());
|
||||||
functionUser(&generatorF, &consumerF);
|
functionUser(&generatorF, &consumerF);
|
||||||
ConsumerFunctor2 f2;
|
|
||||||
GenFunctor g2;
|
|
||||||
functionUser(Utils::cref(g2), Utils::ref(f2));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
} // end namespace
|
} // end namespace
|
||||||
|
|||||||
@@ -39,9 +39,9 @@
|
|||||||
# ifdef __GNUC__
|
# ifdef __GNUC__
|
||||||
# include <tr1/functional>
|
# include <tr1/functional>
|
||||||
# endif
|
# endif
|
||||||
namespace Utils { using std::tr1::function; using std::tr1::ref; using std::tr1::cref; }
|
namespace Utils { using std::tr1::function; }
|
||||||
#else
|
#else
|
||||||
namespace Utils { using std::function; using std::ref; using std::cref; }
|
namespace Utils { using std::function; }
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif // QTC_FUNCTION_H
|
#endif // QTC_FUNCTION_H
|
||||||
|
|||||||
Reference in New Issue
Block a user