Skip to content
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

Add TYPE_SAFE_MSC_EMPTY_BASES to all strong_typedef operations #159

Merged
merged 1 commit into from
Jan 12, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 19 additions & 19 deletions include/type_safe/strong_typedef.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ using underlying_type
/// \group is_strong_typedef
/// Whether a type `T` is a [ts::strong_type]()
template <class T, typename = detail::void_t<>>
struct TYPE_SAFE_MSC_EMPTY_BASES is_strong_typedef : std::false_type
struct is_strong_typedef : std::false_type
{};

/// \group is_strong_typedef
Expand Down Expand Up @@ -425,43 +425,43 @@ namespace strong_typedef_op
/// \exclude
#define TYPE_SAFE_DETAIL_MAKE_STRONG_TYPEDEF_OP(Name, Op) \
template <class StrongTypedef> \
struct Name \
struct TYPE_SAFE_MSC_EMPTY_BASES Name \
{}; \
TYPE_SAFE_DETAIL_MAKE_OP(Op, Name, StrongTypedef) \
TYPE_SAFE_DETAIL_MAKE_OP_COMPOUND(Op## =, Name) \
template <class StrongTypedef, typename Other> \
struct mixed_##Name \
struct TYPE_SAFE_MSC_EMPTY_BASES mixed_##Name \
{}; \
TYPE_SAFE_DETAIL_MAKE_OP_MIXED(Op, mixed_##Name, StrongTypedef) \
TYPE_SAFE_DETAIL_MAKE_OP_COMPOUND_MIXED(Op## =, mixed_##Name) \
template <class StrongTypedef, typename Other> \
struct mixed_##Name##_noncommutative \
struct TYPE_SAFE_MSC_EMPTY_BASES mixed_##Name##_noncommutative \
{}; \
TYPE_SAFE_DETAIL_MAKE_OP_STRONGTYPEDEF_OTHER(Op, mixed_##Name##_noncommutative, StrongTypedef) \
TYPE_SAFE_DETAIL_MAKE_OP_COMPOUND_MIXED(Op## =, mixed_##Name##_noncommutative)

template <class StrongTypedef>
struct equality_comparison
struct TYPE_SAFE_MSC_EMPTY_BASES equality_comparison
{};
TYPE_SAFE_DETAIL_MAKE_OP(==, equality_comparison, bool)
TYPE_SAFE_DETAIL_MAKE_OP(!=, equality_comparison, bool)

template <class StrongTypedef, typename Other>
struct mixed_equality_comparison
struct TYPE_SAFE_MSC_EMPTY_BASES mixed_equality_comparison
{};
TYPE_SAFE_DETAIL_MAKE_OP_MIXED(==, mixed_equality_comparison, bool)
TYPE_SAFE_DETAIL_MAKE_OP_MIXED(!=, mixed_equality_comparison, bool)

template <class StrongTypedef>
struct relational_comparison
struct TYPE_SAFE_MSC_EMPTY_BASES relational_comparison
{};
TYPE_SAFE_DETAIL_MAKE_OP(<, relational_comparison, bool)
TYPE_SAFE_DETAIL_MAKE_OP(<=, relational_comparison, bool)
TYPE_SAFE_DETAIL_MAKE_OP(>, relational_comparison, bool)
TYPE_SAFE_DETAIL_MAKE_OP(>=, relational_comparison, bool)

template <class StrongTypedef, typename Other>
struct mixed_relational_comparison
struct TYPE_SAFE_MSC_EMPTY_BASES mixed_relational_comparison
{};
TYPE_SAFE_DETAIL_MAKE_OP_MIXED(<, mixed_relational_comparison, bool)
TYPE_SAFE_DETAIL_MAKE_OP_MIXED(<=, mixed_relational_comparison, bool)
Expand All @@ -475,7 +475,7 @@ namespace strong_typedef_op
TYPE_SAFE_DETAIL_MAKE_STRONG_TYPEDEF_OP(modulo, %)

template <class StrongTypedef>
struct explicit_bool
struct TYPE_SAFE_MSC_EMPTY_BASES explicit_bool
{
/// \exclude
explicit constexpr operator bool() const
Expand All @@ -486,7 +486,7 @@ namespace strong_typedef_op
};

template <class StrongTypedef>
struct increment
struct TYPE_SAFE_MSC_EMPTY_BASES increment
{
/// \exclude
TYPE_SAFE_CONSTEXPR14 StrongTypedef& operator++()
Expand All @@ -506,7 +506,7 @@ namespace strong_typedef_op
};

template <class StrongTypedef>
struct decrement
struct TYPE_SAFE_MSC_EMPTY_BASES decrement
{
/// \exclude
TYPE_SAFE_CONSTEXPR14 StrongTypedef& operator--()
Expand All @@ -526,7 +526,7 @@ namespace strong_typedef_op
};

template <class StrongTypedef>
struct unary_plus
struct TYPE_SAFE_MSC_EMPTY_BASES unary_plus
{};

/// \exclude
Expand All @@ -543,7 +543,7 @@ namespace strong_typedef_op
}

template <class StrongTypedef>
struct unary_minus
struct TYPE_SAFE_MSC_EMPTY_BASES unary_minus
{};

/// \exclude
Expand Down Expand Up @@ -581,7 +581,7 @@ namespace strong_typedef_op
{};

template <class StrongTypedef>
struct complement
struct TYPE_SAFE_MSC_EMPTY_BASES complement
{};

/// \exclude
Expand Down Expand Up @@ -609,7 +609,7 @@ namespace strong_typedef_op
{};

template <class StrongTypedef, typename IntT>
struct bitshift
struct TYPE_SAFE_MSC_EMPTY_BASES bitshift
{};
TYPE_SAFE_DETAIL_MAKE_OP_MIXED(<<, bitshift, StrongTypedef)
TYPE_SAFE_DETAIL_MAKE_OP_MIXED(>>, bitshift, StrongTypedef)
Expand All @@ -618,7 +618,7 @@ namespace strong_typedef_op

template <class StrongTypedef, typename Result, typename ResultPtr = Result*,
typename ResultConstPtr = const Result*>
struct dereference
struct TYPE_SAFE_MSC_EMPTY_BASES dereference
{
/// \exclude
Result& operator*()
Expand Down Expand Up @@ -650,7 +650,7 @@ namespace strong_typedef_op
};

template <class StrongTypedef, typename Result, typename Index = std::size_t>
struct array_subscript
struct TYPE_SAFE_MSC_EMPTY_BASES array_subscript
{
/// \exclude
Result& operator[](const Index& i)
Expand Down Expand Up @@ -752,7 +752,7 @@ namespace strong_typedef_op
};

template <class StrongTypedef>
struct input_operator
struct TYPE_SAFE_MSC_EMPTY_BASES input_operator
{
/// \exclude
template <typename Char, class CharTraits>
Expand All @@ -765,7 +765,7 @@ namespace strong_typedef_op
};

template <class StrongTypedef>
struct output_operator
struct TYPE_SAFE_MSC_EMPTY_BASES output_operator
{
/// \exclude
template <typename Char, class CharTraits>
Expand Down
Loading