Explicit instantiation of empty template parameter packs

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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: pgplbpCweDdB5.pgp
Description: PGP signature


[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux