I find the move_as example more intuitive and generally "safer". Also my first thought was that std::string(std::move(c)) copied c._value and created a new object out of it, instead of just moving c._value.

Tymi.

On Wed, Jun 4, 2025 at 10:01 AM Jan Schultke <janschultke@googlemail.com> wrote:
> const auto myString = std::move_as<std::string>(c);

This seems more verbose and hard to reason about than the existing:

> const auto myString = std::string(std::move(c));