Specialization of 'template struct std::less' in different namespace

后端 未结 5 1995
予麋鹿
予麋鹿 2020-12-03 13:42

I am specializing the \'less\' (predicate) for a data type.

The code looks like this:

template<>
struct std::less
{
   bool          


        
5条回答
  •  感情败类
    2020-12-03 13:53

    This is still the way to do it. Unfortunately you cannot declare or define functions within a namespace like you would do with a class: you need to actually wrap them in a namespace block.

提交回复
热议问题