C++ Logo

sg10

Advanced search

Re: [SG10] Generalized/relaxed const. expr.

From: Daniel Krügler <daniel.kruegler_at_[hidden]>
Date: Tue, 4 Jun 2013 06:50:35 +0200
2013/6/4 Richard Smith <richard_at_[hidden]>:
> I don't think either *generalized* or *relaxed* is sufficiently
> future-proof.

I agree.

> What happens if C++17 generalizes constants further or relaxes
> more constexpr restrictions? And do we really want people to need to
> remember which features were "generalized" and which were "relaxed"? More
> generally, I don't think we should use names which describe a difference
> between C++ version N and C++ version N+1; instead, we should pick names
> which describe the features objectively (names which still make sense as
> features of C++ version aleph_0).
>
> So, some strawman proposals:
>
> 1) For N2235, use __cpp_constexpr (emphasizing the new keyword)
> For N3652, use __cpp_constexpr_statements (emphasizing that this is an
> extension of __cpp_constexpr, and that the primary change is that it permits
> almost any statements in constexpr functions)
> 2) N2235 has #define __cpp_constexpr 1, and N3652 has #define
> __cpp_constexpr 2.
> 3) N2235 has #define __cpp_constexpr 201103L and N3652 has #define
> __cpp_constexpr 2014xxL.

I prefer variant (3) because it combines the advantages of (a)
allowing for reduction of different names and (b) being extremely
expandable. It would even allow to signal differences within the same
year.

- Daniel

Received on 2013-06-04 06:50:53