Which parts of the C++14 Standard Library could be and which parts will be made constexpr?

前端 未结 2 595
悲&欢浪女
悲&欢浪女 2020-12-09 07:49

With the new relaxed C++14 constexpr rules, compile-time programming becomes a lot more expressive. I wonder whether the Standard Library will also be upgraded to take advan

2条回答
  •  庸人自扰
    2020-12-09 08:27

    Last week (Sep 23-28, 2013) the standards committee added constexpr to more routines in the standard library.

    • forward_as_tuple
    • the operator () method of all the comparison / logical / bitwise named operators. (less, greater, plus, minus, bitwise_and, logical_or, not1 - and the rest)

    @TemplateRex: We're getting closer to sorting arrays at compile time.

    However, we also resolved LWG issue 2013, stating that standard library implementers do NOT have the freedom to make calls that are not defined in the standard as constexpr as constexpr, since that kind of difference between implementations could change the behavior of some code.

提交回复
热议问题