suppose I have a template class
template<typename T>
struct Foo {
struct Bar;
};
specializing Foo<int>::Bar
template<>
struct Foo<int>::Bar {
struct Private; // I want to implement this in .cc for its compile unit use only
}
to implement Private in .cc file
// template<>
struct Foo<int>::Bar::Private {...};
without template<>, it shows "too few template-parameter-lists",
with template<>, it shows explicit specialization of non-template Foo<int>::Bar::Private
I also tried alias Foo<int> and it doesn't work either.
is it possible to implement Private separated from its declaration?
Baris a member of a template one can specialize.Privateis not a member of a template so there is nothing to specialize.