-
Notifications
You must be signed in to change notification settings - Fork 95
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Structural types #411
Comments
Why not? There's already the |
A use case where I would like to use it right away is a template<Reference auto R, OriginOffset auto OO = 0, RepresentationOf<R.quantity_spec.character> Rep = double>
class quantity_point; constexpr auto room_reference_temperature = quantity_point{21 * isq::Celsius_temperature[deg_C]};
constexpr auto temperature_controller_delta = 3 * isq::Celsius_temperature[deg_C];
constexpr quantity_point<isq::Celsius_temperature[deg_C], room_reference_temperature> room_default{0};
constexpr quantity_point<isq::Celsius_temperature[deg_C], room_reference_temperature> room_low = room_default - temperature_controller_delta;
constexpr quantity_point<isq::Celsius_temperature[deg_C], room_reference_temperature> room_high = room_default + temperature_controller_delta; BTW, I hate ISO 80000 for specifying separate quantities for |
You are right! And actually, you highlighted a new issue #412. |
Structural types are the types that can be used as NTTPs.
quantity
andquantity_point
do not satisfy a current definition of a structural type as it requires a class to have public data members. This means that we cannot put them in template parameters which could be really handy in some cases.Should we make a data member public (at least until the C++ language will not extend the definition to allow private members as well)?
The text was updated successfully, but these errors were encountered: