Skip to content

Commit

Permalink
Suppress an MSVC warning in is_operator_able.h
Browse files Browse the repository at this point in the history
  • Loading branch information
braxtons12 committed Jan 31, 2024
1 parent 8fbd345 commit cbbf44f
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions include/hyperion/mpl/type_traits/is_operator_able.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@

#include <concepts>
#include <hyperion/mpl/concepts/operator_able.h>
#include <hyperion/platform.h>
#include <hyperion/platform/def.h>
#include <type_traits>

Expand Down Expand Up @@ -908,7 +909,15 @@ namespace hyperion::mpl::type_traits {
template<typename TLhs, typename TRhs>
requires concepts::Dividible<TLhs, TRhs>
struct is_dividible<TLhs, TRhs> : std::true_type {
// disable MSVC warning about unsafe usaoge of `bool` here
#if HYPERION_PLATFORM_COMPILER_IS_MSVC
_Pragma("warning( push )");
_Pragma("warning( disable : 4804 )");
#endif // HYPERION_PLATFORM_COMPILER_IS_MSVC
using result_type = decltype(std::declval<TLhs>() / std::declval<TRhs>());
#if HYPERION_PLATFORM_COMPILER_IS_MSVC
_Pragma("warning( pop )");
#endif // HYPERION_PLATFORM_COMPILER_IS_MSVC
};

/// @brief Value of the type trait `is_dividible` .
Expand Down

0 comments on commit cbbf44f

Please sign in to comment.