Namespaces
Variants
Views
Actions

Talk:cpp/language/partial specialization

From cppreference.com

The Partial Ordering example should have its own definition of A because there are too many of them that come "before".

indeed there are a few.. I'll rename. --Cubbi (talk) 13:25, 27 January 2016 (PST)

[edit] explicit definition of a class template

Consider this example:

template<class... Args>
struct Foo
{
    // some big class, dealing with Args... etc.
    void member(int);
};

I want to define Foo::member for 1 or 2 args:

template<class P0>
void Foo<P0>::member(int) { ... }
 
template<class P1>
void Foo<int, P1>::member(int) { ... }
 
template<class P0, class P1>
void Foo<P0, P1>::member(int) { ... }

is that possible somehow without specialization of the whole Foo class and copying all the other definitions in it again and again? --Roker (talk)