template specialization inside class namespace
How to specialize a template defined in some external namespace in the body of my class?
Concrete example using BGL which doesn't compile:
class A
{
namespace boost
{
template <class ValueType>
struct container_gen<SomeSelectorS, ValueType>
{
typedef std::multiset<ValueType,MyClass<ValueType> > type;
};
}
}
If one moves specialization of container_gen out of class A everything works great. The specifi开发者_如何学编程c problem is that I don't know how to reference "boost" namespace from class A.
You cannot create namespaces inside classes, and you cannot specialize a template in a namespace scope inside a class.
精彩评论