Date: Sun, 22 Nov 2020 16:44:34 +0100
Constinit = Initialized with compile time constant.
niedz., 22 lis 2020, 16:08 użytkownik Nicolai Josuttis via Ext <
ext_at_[hidden]> napisał:
> Starting to learn and document C++20, I just realized that
> the keyword "constinit" seems very confusing.
> Every naive programmer would assume it means "init a const",
> but it seems the const is simply wrong; it is the opposite.
> Or as Jonathan Müller wrote in a talk:
> constinit = constexpr - const
>
> Now I wonder how to teach that.
> Could somebody elaborate please why we have chosen this name
> and what is the best way to make this name plausible to ordinary
> programmers?
>
> Thanks
> Nico
>
> --
> Nicolai M. Josuttis
> www.josuttis.de
> _______________________________________________
> Ext mailing list
> Ext_at_[hidden]
> Subscription: https://lists.isocpp.org/mailman/listinfo.cgi/ext
> Link to this post: http://lists.isocpp.org/ext/2020/11/15297.php
>
niedz., 22 lis 2020, 16:08 użytkownik Nicolai Josuttis via Ext <
ext_at_[hidden]> napisał:
> Starting to learn and document C++20, I just realized that
> the keyword "constinit" seems very confusing.
> Every naive programmer would assume it means "init a const",
> but it seems the const is simply wrong; it is the opposite.
> Or as Jonathan Müller wrote in a talk:
> constinit = constexpr - const
>
> Now I wonder how to teach that.
> Could somebody elaborate please why we have chosen this name
> and what is the best way to make this name plausible to ordinary
> programmers?
>
> Thanks
> Nico
>
> --
> Nicolai M. Josuttis
> www.josuttis.de
> _______________________________________________
> Ext mailing list
> Ext_at_[hidden]
> Subscription: https://lists.isocpp.org/mailman/listinfo.cgi/ext
> Link to this post: http://lists.isocpp.org/ext/2020/11/15297.php
>
Received on 2020-11-22 09:44:48