variadic templates and explicit instantiation

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

 



Maybe I'm confused, but I'm having trouble with explicit instantiation
of variadic templates.

Example:

x.hh:
        template < class T, class ... P > std::shared_ptr < T > make(P
... args);

xx.cc:
        template < class T, class ... P > std::shared_ptr < T > make(P ... args)
        {
                return std::shared_ptr < T > (new T(args ...));
        };
        template std::shared_ptr < File > make < File, char const
*>(char const *); // works
        template std::shared_ptr < Include > make < Include, char
const *, bool > (char const *, bool); // doesn't work

That last line gets

 error: template-id 'make<Include, const char*, bool>' for
'std::shared_ptr<Include> make(const char*, bool)' does not match any
template declaration

(gcc 4.6)

So ... should I write that differently (how?), or is gcc confused here?


[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