This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Explicit instantiation of empty template parameter packs
- From: Sam Varshavchik <mrsam at courier-mta dot com>
- To: gcc-help at gcc dot gnu dot org
- Date: Thu, 26 Jan 2012 22:32:48 -0500
- Subject: 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