mirror of
https://github.com/boostorg/functional.git
synced 2026-01-26 17:02:32 +01:00
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:
@@ -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
|
||||
|
||||
@@ -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() {
|
||||
|
||||
Reference in New Issue
Block a user