C++ Logo

std-discussion

Advanced search

error building pairs / tuples with consteval-only constructible types

From: tobi_at <tobi_at_[hidden]>
Date: Mon, 05 Dec 2022 12:06:27 +0100
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.

-- Tobias

Received on 2022-12-05 11:06:40