admin管理员组

文章数量:1125329

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  for its compile unit use only
}

to implement Private in 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?

本文标签: cHow to implement a class of a specialized template classStack Overflow