C++ Logo

STD-PROPOSALS

Advanced search

Subject: Re: [std-proposals] "Union types" syntactic sugar
From: Michał Piotr Gawron (mcvsama_at_[hidden])
Date: 2020-03-04 10:29:33


On 04.03.2020 15:23, Sebastian Büttner via Std-Proposals wrote:
> What's wrong with that (sorry for the terrible name):
>
> template<typenameT, typename... Us>
> conceptany_of = (std::is_same_v<T, Us> || ...);
>
> voidf(any_of<char, uint8_t> autox);
>
> template<any_of<char, uint8_t> T>
> voidf(std::basic_string<T> x);

Ah, it looks like I could use this, it's quite readable to me. (I'm not
very familiar with concepts yet.)

Is there a way to have the std::basic_string<> version that would be
more similar to this?

void f (std::basic_string<any_of<char, uint8_t>> x);

?

-- 
Michał Gawron
mcv.mulabs.org

STD-PROPOSALS list run by herb.sutter at gmail.com

Standard Proposals Archives on Google Groups