C++ Logo


Advanced search

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

From: Daniel Krügler <daniel.kruegler_at_[hidden]>
Date: Mon, 5 Dec 2022 12:42:50 +0100
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


This paper has just been accepted at the Konar meeting.

- Daniel

Received on 2022-12-05 11:43:02