Skip to content
Snippets Groups Projects

Fix compilation warnings when building type is RelWithDebInfo

1 file
+ 9
10
Compare changes
  • Side-by-side
  • Inline
+ 9
10
@@ -102,16 +102,15 @@ struct AssertChecker<std::tuple<Args...> >
@@ -102,16 +102,15 @@ struct AssertChecker<std::tuple<Args...> >
#else // NDEBUG
#else // NDEBUG
#define Assert(...) \
#define Assert(...) \
{ \
{ \
using TupleArgs = decltype(std::make_tuple(__VA_ARGS__)); \
using TupleArgs = decltype(std::make_tuple(__VA_ARGS__)); \
AssertChecker<TupleArgs>::check_args_type(); \
AssertChecker<TupleArgs>::check_args_type(); \
constexpr int tuple_size = std::tuple_size_v<TupleArgs>; \
constexpr int tuple_size = std::tuple_size_v<TupleArgs>; \
static_assert(tuple_size >= 1 and tuple_size <= 2); \
static_assert(tuple_size >= 1 and tuple_size <= 2); \
auto args = std::forward_as_tuple(__VA_ARGS__); \
if (not static_cast<bool>(std::get<0>(std::forward_as_tuple(__VA_ARGS__)))) { \
if (not static_cast<bool>(std::get<0>(args))) { \
throw AssertError(__FILE__, __LINE__, __PRETTY_FUNCTION__, std::forward_as_tuple(__VA_ARGS__), #__VA_ARGS__); \
throw AssertError(__FILE__, __LINE__, __PRETTY_FUNCTION__, args, #__VA_ARGS__); \
} \
} \
}
}
#endif // NDEBUG
#endif // NDEBUG
Loading