This gives also a compilation error on vs2010: void F() { boost::reference_wrapper<float (* const)(float)> wrap(&cosf); //std::reference_wrapper<float (* const)(float)> wrap(&cosf); //ok } 1>KTestCuj2005June1.cpp(182): error C2248: 'boost::reference_wrapper<T>::reference_wrapper' : cannot access private member declared in class 'boost::reference_wrapper<T>' 1> with 1> [ 1> T=float (__cdecl *const )(float) 1> ] 1> C:\work sdk\boost_1_57_0\boost/core/ref.hpp(85) : see declaration of 'boost::reference_wrapper<T>::reference_wrapper' 1> with 1> [ 1> T=float (__cdecl *const )(float) 1> ] ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
ok can be solved by not using pointer to function type, but function type: void F() { boost::reference_wrapper<float (float)> wrap(cosf); }
participants (1)
-
gast128