Class nested inside a template class as template function argument type

C

claudiu

Hi,

I run into a bit of trouble trying to compile the code below.

template<typename T>
struct Out
{
struct In{};
};

template<typename T>
void use(const typename Out<T>::In& r){}

void test()
{
use(Out<int>::In());
}

Using Comeau compiler I get the error:

line 13: error: no instance of function template "use" matches the
argument list
The argument types that you used are: (Out<int>::In)
use(Out<int>::In());
^

It looks like the template function use cannot deduce the argument
type but I can't understand why. Maybe someone out there can shed some
light on this?

Many thanks,
Claudiu
 
A

August Karlstrom

Hi,

I run into a bit of trouble trying to compile the code below.

template<typename T>
struct Out
{
struct In{};
};

Try comp.lang.c++ instead.

/August
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,014
Latest member
BiancaFix3

Latest Threads

Top