开发者

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜