Skip to content

Commit

Permalink
fix constexpr_max
Browse files Browse the repository at this point in the history
  • Loading branch information
hedzr committed Nov 18, 2024
1 parent 42f3572 commit 47119b7
Showing 1 changed file with 15 additions and 9 deletions.
24 changes: 15 additions & 9 deletions libs/cmdr11/include/cmdr11/cmdr_defs.hh
Original file line number Diff line number Diff line change
Expand Up @@ -942,16 +942,24 @@ namespace cmdr { namespace cross {
//


#if !defined(_CONSTEXPR_MINMAX_DEFINED)
#define _CONSTEXPR_MINMAX_DEFINED
// #if !defined(_CONSTEXPR_MINMAX_DEFINED)
// #define _CONSTEXPR_MINMAX_DEFINED
//
// template<typename T>
// struct always_false : std::false_type {};
//
// template<typename T>
// [[maybe_unused]] constexpr bool always_false_v = always_false<T>::value;
//
// #endif //!defined(_CONSTEXPR_MINMAX_DEFINED)

template<typename T>
struct always_false : std::false_type {};
namespace cmdr { namespace cross {
template<typename T>
struct always_false : std::false_type {};

template<typename T>
[[maybe_unused]] constexpr bool always_false_v = always_false<T>::value;
template<typename T>
[[maybe_unused]] constexpr bool always_false_v = always_false<T>::value;

namespace cmdr { namespace cross {
template<typename T>
constexpr T constexpr_max(T a) {
return a;
Expand Down Expand Up @@ -985,8 +993,6 @@ namespace cmdr { namespace cross {
}
} // namespace cmdr::cross

#endif //!defined(_CONSTEXPR_MINMAX_DEFINED)

#ifndef _CONST_CHARS_DEFINED
#define _CONST_CHARS_DEFINED
typedef const char *const_chars;
Expand Down

0 comments on commit 47119b7

Please sign in to comment.