C++ Logo

std-proposals

Advanced search

Re: [std-proposals] Initial draft for C++: Uniform Initialization for Multiple Variables

From: Marcin Jaczewski <marcinjaczewski86_at_[hidden]>
Date: Mon, 12 Aug 2024 14:16:13 +0200
pon., 12 sie 2024 o 14:01 Sebastian Wittmeier via Std-Proposals
<std-proposals_at_[hidden]> napisał(a):
>
> Hi Marcin,
>
>
>
> is make3 defined in std? Or just an example, what could be quickly defined?
>

Quirky defined, like:

```
template<typename T, typename V>
auto make3(const V& v)
{
    return std::tuple<T, T, T>{ v, v, v };
}
```

If someone determined he could make `std::array` and put `3` in
template parameters.
How much boilerplate is up to the user, if its only used in a couple
of places this could be fine.

>
> -----Ursprüngliche Nachricht-----
> Von: Marcin Jaczewski via Std-Proposals <std-proposals_at_[hidden]>
> ```
> auto [var1, var2, var3] = make3<type>(value);
> ```
>
> --
> Std-Proposals mailing list
> Std-Proposals_at_[hidden]
> https://lists.isocpp.org/mailman/listinfo.cgi/std-proposals

Received on 2024-08-12 12:16:28