草庐IT

c++ - friend 模板特化声明中不允许使用 Consexpr?

我正在将C++14-constexpr代码库从Clang移植到最新的g++-5.1。考虑以下自Clang3.3的Restful时期以来一直正确编译的本土bitset类的简化代码片段(现在快2年了!)#includetemplateclassbitset;templateconstexprbooloperator==(constbitset&lhs,constbitset&rhs)noexcept;templateclassbitset{friendconstexprbooloperator==(constbitset&,constbitset&)noexcept;//^^^^^^^^^