mirror of
https://github.com/aantron/better-enums.git
synced 2025-12-06 16:56:42 +08:00
Fixed some warnings with strict flags.
This commit is contained in:
parent
9810dd07ce
commit
d90bfd6f18
13
enum.h
13
enum.h
@ -89,6 +89,12 @@
|
|||||||
# define BETTER_ENUMS__IF_EXCEPTIONS(x)
|
# define BETTER_ENUMS__IF_EXCEPTIONS(x)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef __GNUC__
|
||||||
|
# define BETTER_ENUMS__UNUSED(x) x __attribute__((__unused__))
|
||||||
|
#else
|
||||||
|
# define BETTER_ENUMS__UNUSED(x) x
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// Higher-order preprocessor macros.
|
// Higher-order preprocessor macros.
|
||||||
@ -333,7 +339,8 @@ BETTER_ENUMS__CONSTEXPR static T* _or_null(optional<T*> maybe)
|
|||||||
// causes a linking error.
|
// causes a linking error.
|
||||||
|
|
||||||
template <typename T, typename U>
|
template <typename T, typename U>
|
||||||
BETTER_ENUMS__CONSTEXPR U continue_with(T ignored, U value) { return value; }
|
BETTER_ENUMS__CONSTEXPR U
|
||||||
|
continue_with(T BETTER_ENUMS__UNUSED(ignored), U value) { return value; }
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -345,8 +352,8 @@ struct _eat_assign {
|
|||||||
{ }
|
{ }
|
||||||
|
|
||||||
template <typename Any>
|
template <typename Any>
|
||||||
BETTER_ENUMS__CONSTEXPR const _eat_assign& operator =(Any dummy) const
|
BETTER_ENUMS__CONSTEXPR const _eat_assign&
|
||||||
{ return *this; }
|
operator =(Any BETTER_ENUMS__UNUSED(dummy)) const { return *this; }
|
||||||
|
|
||||||
BETTER_ENUMS__CONSTEXPR operator EnumType () const { return _value; }
|
BETTER_ENUMS__CONSTEXPR operator EnumType () const { return _value; }
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user