Re: [sigc] C++0x lambdas



On 13/07/2012 22:53, Kjell Ahlstedt wrote:
> 
> 
> I'm also interested in the amendment you mention that compiles with -std=c++98.
> Are you willing to show it? It's not very attractive to include BOOST_TYPEOF in
> libsigc++, but still I'm interested, to see if it's something that I should
> consider for my bug report.

To be honest, I had actually lost that snippet of code, but it turns out it
wasn't too difficult to re-do based on the C++11 version:

//-------------------
namespace sigc
{
    template <typename Functor>
    struct functor_trait<Functor, false>
    {
        typedef BOOST_TYPEOF_TPL (sigc::mem_fun
                                  (boost::declval<Functor&> (),
                                   &Functor::operator())) _intermediate;


        typedef typename _intermediate::result_type result_type;
        typedef Functor functor_type;
    };
}
//-------------------

-- 
Kind regards,
Loong Jin


Attachment: signature.asc
Description: OpenPGP digital signature



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]