[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: C++17 skeleton with move semantics and std::variant
From: |
Hans Åberg |
Subject: |
Re: C++17 skeleton with move semantics and std::variant |
Date: |
Mon, 9 Apr 2018 18:31:16 +0200 |
> On 9 Apr 2018, at 18:17, Frank Heckenbach <address@hidden> wrote:
>
> Hans Åberg wrote:
>
>>> So for C++ we could either go back and disable the static type
>>> checking completely, or do full dynamic checking (which std::variant
>>> does by itself). I choose the latter. As you said, the performance
>>> impact should be small, and the safety benefit substantial. (If
>>> someone doesn't want it, they might be able to use an alternative
>>> variant implementation without checks, or not use variant at all
>>> ...)
>>
>> That might be the difference: C++, unlike C, needs the types to
>> select the right constructors. To get those and not only PODs was
>> one motivation for introducing the variants.
>
> Indeed, if one only wants to use PODs in C++, one can use the C
> template (which I did until recently), so there's not much point
> (IMHO) to a C++ template that supports only PODs.
There were much discussion about that, leading up to the variants.
- C++17 skeleton with move semantics and std::variant, Frank Heckenbach, 2018/04/08
- Re: C++17 skeleton with move semantics and std::variant, Hans Åberg, 2018/04/08
- Re: C++17 skeleton with move semantics and std::variant, Hans Åberg, 2018/04/09
- Re: C++17 skeleton with move semantics and std::variant, Frank Heckenbach, 2018/04/09
- Re: C++17 skeleton with move semantics and std::variant, Hans Åberg, 2018/04/09
- Re: C++17 skeleton with move semantics and std::variant, Hans Åberg, 2018/04/09
Re: C++17 skeleton with move semantics and std::variant, Hans Åberg, 2018/04/09