DoorKeeper/include/doorkeeper/helpers/typename.hpp

76 lines
1.7 KiB
C++

#ifndef id3A8D22AD652142C9A44142EC942E4482
#define id3A8D22AD652142C9A44142EC942E4482
#include "doorkeeper/implem/doorkeeper_conf.h"
#if (defined(__clang__) && \
(__clang_major__ == 3 && __clang_minor__ > 5) || (__clang_major__ > 3) \
) || (defined(IS_ORIGINAL_GNUC) && \
(__GNUC__ == 5 && __GNUC_MINOR__ >= 1) || (__GNUC__ > 5) \
)
# define IS_PRETTY_FUNC_CONSTEXPR
#elif defined(__GNUC__)
//uhm.. nothing :p
#else
# error "Unknown compiler"
#endif
#if defined(IS_PRETTY_FUNC_CONSTEXPR)
# include "sprout/string.hpp"
# include "doorkeeper/implem/tiger_bt.hpp"
# include <stdexcept>
#endif
#include "doorkeeper/implem/compatibility.h"
#include <cstdint>
#include <ciso646>
namespace dk {
#if !defined(IS_PRETTY_FUNC_CONSTEXPR)
struct HashType {
uint64_t a;
uint64_t b;
uint64_t c;
};
#endif
bool operator< ( const HashType& parL, const HashType& parR );
namespace implem {
HashType hash_string ( const char* parString, std::size_t parLen ) a_pure;
#if defined(IS_PRETTY_FUNC_CONSTEXPR)
template <typename T>
struct type_name_info {
constexpr type_name_info ( void );
const std::size_t len;
const char* const str;
};
template <typename T>
constexpr std::size_t type_name_len ( void ) a_pure;
#endif
} //namespace implem
template <typename T>
#if defined(IS_PRETTY_FUNC_CONSTEXPR)
constexpr
#endif
HashType type_name_hash ( void ) a_pure;
template <typename T>
#if defined(IS_PRETTY_FUNC_CONSTEXPR)
constexpr sprout::string<implem::type_name_len<T>()> type_name ( void ) a_pure;
#else
std::string type_name ( void ) a_pure;
#endif
} //namespace dk
#include "doorkeeper/implem/typename.inl"
#if defined(IS_PRETTY_FUNC_CONSTEXPR)
# undef IS_PRETTY_FUNC_CONSTEXPR
#endif
#endif