This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Explicit instantiation of empty template parameter packs


Given the following template, with gcc 4.6 and -std=c++0x:

=============================================================================

template<typename... Args>
void foo(Args... args)
{
}

=============================================================================

Both "foo();" and "foo(4);" compiles, as expected. If I want to explicitly instantiate both template signatures:

template void foo(int);

This goes through. But this does not:

template void foo();

gcc 4.6 rejects this:

/tmp/t.C:16:15: error: template-id âfoo<>â for âvoid foo()â does not match any template declaration

How do I tell gcc to explicitly instantiate template with an empty parameter pack. It'll obviously instantiate it implicitly, since "foo();" gets compiled, as expected.

Attachment: pgp00000.pgp
Description: PGP signature


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]