C++ Logo

STD-PROPOSALS

Advanced search

Subject: Re: [std-proposals] std::as
From: Emile Cormier (emile.cormier.jr_at_[hidden])
Date: 2020-10-28 15:10:18


Date: Mon, 26 Oct 2020 15:17:57 -0400
> From: "Arthur O'Dwyer"

But then your `std::as` proposal still has two problems that need solving
> via bikeshedding:
> - You cannot use the name `as` because it's too short; I guarantee
> somebody
> out there has a list of A objects named `as` (and is also `using namespace
> std`).
> - You should not use the name `as` because it's literally shorter than the
> "checked" version `std::get`. The "unsafe" version should be something
> long
> and scary-looking, that newbies can't start using by accident.

 How about std::alternative<T>, which matches up nicely with
std::variant::holds_alternative<T> ?



STD-PROPOSALS list run by std-proposals-owner@lists.isocpp.org

Standard Proposals Archives on Google Groups