草庐IT

DateTimeKey

全部标签

c++ - 'template<class _Tp> struct std::less' 在不同命名空间中的特化

我专门针对数据类型使用“少”(谓词)。代码如下所示:templatestructstd::less{booloperator()(constDateTimeKey&k1,constDateTimeKey&k2)const{//Somecode...}};编译时(Ubuntu9.10上的g++4.4.1),我收到错误:'templatestructstd::less'在不同命名空间的特殊化我做了一些研究,发现有一个“解决方法”涉及将特化包装在std命名空间中-即将代码更改为:namespacestd{templatestructless{booloperator()(constDateT

c++ - 'template<class _Tp> struct std::less' 在不同命名空间中的特化

我专门针对数据类型使用“少”(谓词)。代码如下所示:templatestructstd::less{booloperator()(constDateTimeKey&k1,constDateTimeKey&k2)const{//Somecode...}};编译时(Ubuntu9.10上的g++4.4.1),我收到错误:'templatestructstd::less'在不同命名空间的特殊化我做了一些研究,发现有一个“解决方法”涉及将特化包装在std命名空间中-即将代码更改为:namespacestd{templatestructless{booloperator()(constDateT