Boost logo

Boost :

Subject: [boost] [typeof] failed to compile under dependent context
From: feverzsj (feverzsj_at_[hidden])
Date: 2014-04-03 02:56:02


hi, list

  here is some code failed to compile with msvc9. Not sure if it is wrong
use case or bug.

template<class T>
struct A
{
    static T apply() { return T(); }
};

template<class T>
struct B
{
    typedef BOOST_TYPEOF_TPL(A<T>::apply()) type; // error C2064: term
does not evaluate to a function taking 0 arguments
};

template<class T>
BOOST_TYPEOF_TPL(A<T>::apply()) foo2() // error C2064: term does not
evaluate to a function taking 0 arguments
{
}

template<class T>
void foo1()
{
    BOOST_TYPEOF_TPL(A<T>::apply()) t; // ok
}

Regards, zsj

--
View this message in context: http://boost.2283326.n4.nabble.com/boost-typeof-failed-to-compile-under-dependent-context-tp4660935.html
Sent from the Boost - Dev mailing list archive at Nabble.com.

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk