type_safe
type_safe copied to clipboard
strong_typedef: numeric_limits
I'm new to this lib, but I like the idea very much.
What about numeric_limits? I know that std::chrono:duration defines them on the type itself, but I would also be happy with some external limits type. What I don't like is this amount of characters:
struct my_type
: type_safe::strong_typedef<my_type, std::int32_t>
, type_safe::strong_typedef_op::equality_comparison<my_type>
, type_safe::strong_typedef_op::relational_comparison<my_type>
, type_safe::strong_typedef_op::integer_arithmetic<my_type>
{}
constexpr my_type max { std::numeric_limits<ts::underlying_type<my_type>>::max() };
what about something like my_type::max()
?
I'm not a big fan, as it requires a limit include and isn't such a common functionality.