Why are type_traits implemented with specialized template structs instead of constexpr?

后端 未结 5 1798
别跟我提以往
别跟我提以往 2021-01-12 00:40

Is there any reason why the standard specifies them as template structs instead of simple boolean constexpr?

In an additional question that

5条回答
  •  情话喂你
    2021-01-12 00:53

    Probably because boost already had a version of type_traits that was implemented with templates.

    And we all know how much people on the standards committee copy boost.

提交回复
热议问题