【发布时间】:2010-08-12 16:50:41
【问题描述】:
如何专门化在我的类主体中的某个外部命名空间中定义的模板?
使用无法编译的 BGL 的具体示例:
class A
{
namespace boost
{
template <class ValueType>
struct container_gen<SomeSelectorS, ValueType>
{
typedef std::multiset<ValueType,MyClass<ValueType> > type;
};
}
}
如果将 container_gen 的专业化移出 A 类,一切都会很好。具体问题是我不知道如何从 A 类中引用“boost”命名空间。
【问题讨论】:
-
你想做什么,而在课堂外专攻它是无法做到的?
标签: c++ namespaces template-specialization information-hiding