Added a specialization to deduced F from boost::function<F> removing the need to register boost::function for type-of emulation (because it required to register boost::functionN instead of boost::function and that was confusing).

[SVN r77891]
This commit is contained in:
Lorenzo Caminiti
2012-04-10 19:17:41 +00:00
parent e7e599a7d2
commit 9e7ccedcfe
3 changed files with 13 additions and 8 deletions

View File

@@ -19,13 +19,6 @@ int (&identity_i)(int) = identity_i_impl; // Function reference.
double identity_d_impl(double x) { return x; }
boost::function<double (double)> identity_d = identity_d_impl; // Functor.
// For type-of emulation on compilers without native type-of.
#include <boost/typeof/typeof.hpp>
#include <boost/typeof/std/string.hpp>
#include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP()
BOOST_TYPEOF_REGISTER_TEMPLATE(boost::function, 1)
BOOST_TYPEOF_REGISTER_TEMPLATE(boost::function1, 2) // Also `functionN`.
//]
#endif // #include guard

View File

@@ -7,6 +7,8 @@
#include "identity.hpp"
#include <boost/functional/overloaded_function.hpp>
#include <boost/typeof/typeof.hpp> // For `BOOST_AUTO`.
#include <boost/typeof/std/string.hpp> // No need to register `boost::function`.
#include <boost/detail/lightweight_test.hpp>
int main() {