首页 > 编程语言 > 详细

C++11版本不能使用一个单行命名空间方式特化一个函数的bug

时间:2019-11-27 09:52:02      阅读:124      评论:0      收藏:0      [点我收藏+]

warning: specialization of ‘template<class _Iterator> struct std::iterator_traits’ in different namespace [-fpermissive]

template<> class std::iterator_traits<Token_ptr>{
public:
    typedef Word difference_type;
    typedef Word value_type;
    typedef Token_ptr pointer;
    typedef Word& reference ;
    typedef std::bidirectional_iterator_tag iterator_category ;
};

While everything works correctly, does any body know what exactly means and why is issued the warning. ( g++ issues the warning while clang++ doesn‘t ).

https://stackoverflow.com/questions/25594644/warning-specialization-of-template-in-different-namespace
// gcc编译器处理模板特化的一个bug,必须此处用不能用单行命名空间,只能用大括号的命名空间

C++11版本不能使用一个单行命名空间方式特化一个函数的bug

原文:https://www.cnblogs.com/dongzhiquan/p/11939403.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!