------- Comment #11 from piotr dot wyderski at gmail dot com  2009-04-07 15:02 
-------
Subject: Re:  std::result_of doesn't work

2009/4/7 jwakely dot gcc at gmail dot com <gcc-bugzi...@gcc.gnu.org>:

> what you probably want is:

In fact I want to copy the return type of a template method restore
and use as another method's return type ina C++0x way. This
works:

       class S {

        template <typename T>
          typename
boost::function_traits<decltype(traits<T>::restore)>::result_type

            restore() {

            return traits<T>::restore(*this);
        }
        };

but the std::result_of-based soludins do not. The lambda-like syntax
also does not work, because "this" is not available at the outer scope:

template <typename T> auto restore() -> decltype(traits<T>::restore(*this)) {

    return traits<T>::restore(*this);
}


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39676

Reply via email to