add nameof enum max search depth param

This commit is contained in:
Neargye 2018-09-01 22:33:26 +05:00
parent 3634092bf2
commit e32c19e70f

View file

@ -48,6 +48,10 @@
# define NAMEOF_CONSTEXPR inline
#endif
#if !defined(NAMEOF_ENUM_MAX_SEARCH_DEPTH)
# define NAMEOF_ENUM_MAX_SEARCH_DEPTH 64
#endif
namespace nameof {
namespace detail {
@ -393,12 +397,12 @@ struct NameofEnumImpl {
};
template <typename T>
struct NameofEnumImpl<T, 128> {
struct NameofEnumImpl<T, NAMEOF_ENUM_MAX_SEARCH_DEPTH> {
NAMEOF_CONSTEXPR nameof::cstring operator()(T) const { return {}; }
};
template <typename T>
struct NameofEnumImpl<T, -128> {
struct NameofEnumImpl<T, -NAMEOF_ENUM_MAX_SEARCH_DEPTH> {
NAMEOF_CONSTEXPR nameof::cstring operator()(T) const { return {}; }
};