C++ Logo

std-discussion

Advanced search

Re: error building pairs / tuples with consteval-only constructible types

From: tobi_at <tobi_at_[hidden]>
Date: Mon, 05 Dec 2022 14:58:23 +0100
Thanks for the link 
I think you are right. § 4 rule 1 includes constructors, so it would solve my problem.

Am 05.12.2022 12:42 schrieb Daniel Krügler <daniel.kruegler_at_[hidden]>:

Am Mo., 5. Dez. 2022 um 12:06 Uhr schrieb Tobias Loew via
Std-Discussion <std-discussion_at_[hidden]>:
>
> Trying to create a pair / tuple with types, which have only consteval
> constructors, currently results in an error “'this' is not a constant
> expression” (on gcc).
> (Example: https://godbolt.org/z/fY86TaKev)
> It would compile, if consexpr constructors would be aware of being
> invoked on a consexpr instance and then behave like a consteval
> constructor.
> Otherwise there is currently no way to create pairs or tuples with
> consteval-only constructible types.

Yes, consteval is currently invasive. There exist a proposal that
might fix your problem, see

https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2564r3.html

This paper has just been accepted at the Konar meeting.

- Daniel


Received on 2022-12-05 13:58:35