C++ Logo

std-proposals

Advanced search

Re: The new new thing

From: Matt Hurd <matthurd_at_[hidden]>
Date: Fri, 21 Feb 2020 12:48:51 +1100
>
>
> 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 :-)

--Matt.

Received on 2020-02-20 19:51:48