cerevra / int

38 stars 6 forks source link

std::make_unsigned and std::make_signed #12

Closed dix75 closed 7 years ago

dix75 commented 7 years ago

It will be better if you specialize the structures for wide_int types and those structures as well

std::is_signed
std::is_unsigned
cerevra commented 7 years ago

These features cannot be specialized by standard. Sorry

dix75 commented 7 years ago

It's not absolutely true. The standard nothing says about that. But generally speaking, you right, also your proposal pretend to be including to new version of standard thus it will be better if you implement that structures as in another the fixed-point proposal (see that https://github.com/johnmcfarlane/fixed_point/blob/develop/include/sg14/numeric_traits) That structures were implemented in another namespace.

But your right, also it's not convenient.

apolukhin commented 7 years ago

We had those specializations in previous version of the library.

Direct instructions at the previous ISO C++ WG21 meeting were to remove those specializations, as they are wrong: is_signed and is_unsigned are meant to work for fundamental build in types only.

This may change later in SG6/EWG/LEWG/LWG groups. At this point SG6 plans to rely upon std::numeric_limits<>::is_signed instead.

dix75 commented 7 years ago

We had those specializations in previous version of the library.

ok