Boost logo

Boost :

From: Tobias Schwinger (tschwinger_at_[hidden])
Date: 2006-12-27 07:55:23


here's another result_of question:

Given a function object

    struct f
        template< typename T >
        r<T> operator()(T const &) const;

        template< typename T >
        r<T&> operator()(T &) const;

        template< typename Sig >
        struct result;


    result_of< f(some_obj &) >::type // is r<T&>
    result_of< f(some_obj const & >::type // is r<T>

but what about:

    result_of< f(some_obj) >::type // is r<T>?

That's what I'd do intuitively. I also found an example (written by Dave) on the net that seems to do the same:

But wait: the TR1 text is talking about lvalues so I probably should let F::result return r<T&>?!

Thanks a lot for clarification.


Boost list run by bdawes at, gregod at, cpdaniel at, john at