
13 May
2008
13 May
'08
4:29 p.m.
AMDG Marco Costalba wrote:
BTW MSF implementation _really_ needs set() and not only operator=(), because for SFINAE to work I need an additional (hidden) argument for each assignment call. Indeed if you look at overload.hpp, operator=() implementation is just:
template<typename Fun> function& operator=(Fun const& f) { this->set(f); return *this; }
And set() is a public method so it is usable directly by the user.
For everything but constructors, you can use SFINAE on the return type. template<typename Fun> typename boost::enable_if<..., function&>::type operator=(Fun const& f); In Christ, Steven Watanabe