C++ Logo

std-proposals

Advanced search

Re: The new new thing

From: Михаил Найденов <mihailnajdenov_at_[hidden]>
Date: Fri, 21 Feb 2020 09:44:42 +0200
On Fri, Feb 21, 2020 at 3:49 AM Matt Hurd via Std-Proposals <
std-proposals_at_[hidden]> wrote:

>
>> For aggregates you don’t need to write constructors. For double/other
>> non-integrals it would be as simple as
>> struct radians{
>> double value;
>> };
>>
>> Also, I suppose a question would be how you intended to get the value out
>> of the “new” types. If by static_cast, I could see the removal of the
>> boilerplate to get that being a potential positive for your method (though
>> maybe not enough to justify a core language extension, I don’t know).
>>
>

> I currently get by with a suite of macros and hana introspection to add
> relational, iostream, and arithmetic operations as is appropriate to value
> wrappers and aggregates. I wrote the OP shortly after yet another
> frustrating debugging session with hana's EqualityComparable on Struct
> concepts. Simple things should be simple is my thought for the day :-)
>

This is not simple however. Strong typedef are researched (multiple papers
by "best minds") for 20 years and they appear simple only on the surface.
Once you dig enough on exactly what the semantics are going to be you end
up with an entire new sub-system with its sub-langauge
And this is in direct competition to the already available wrapping, making
hard sell.
In the meanwhile there are many small improvements that diminish their
values further by making current and alternative ways easier - enum class
for ints, inherent ctors, spaceship op, soon reflection, "soon" language
variant



> --Matt.
>
> --
> Std-Proposals mailing list
> Std-Proposals_at_[hidden]
> https://lists.isocpp.org/mailman/listinfo.cgi/std-proposals
>

Received on 2020-02-21 01:47:35