Cannot refer to a template name nested in a template parameter

Posted by chila on Stack Overflow See other posts from Stack Overflow or by chila
Published on 2010-05-18T19:25:46Z Indexed on 2010/05/18 19:50 UTC
Read the original article Hit count: 209

Filed under:

I have the following code:

template <typename Provider>
inline void use()
{
    typedef Provider::Data<int> D;
}

Where I'm basically trying to use a template class member 'Data' of some 'Provider' class, applied to 'int', but I get the following errors:

util.cpp:5: error: expected init-declarator before '<' token
util.cpp:5: error: expected `,' or `;' before '<' token

I'm using GCC 4.3.3 on a Solaris System.

© Stack Overflow or respective owner

Related posts about c++