C++ Logo

STD-PROPOSALS

Advanced search

Subject: Re: [std-proposals] The new new thing
From: Matt Hurd (matthurd_at_[hidden])
Date: 2020-02-20 19:48:51


>
>
> 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.



STD-PROPOSALS list run by herb.sutter at gmail.com

Standard Proposals Archives on Google Groups