DoorKeeper/include/doorkeeper/implem/hashing.inl
King_DuckZ dba88117e4 Use build time strings for pretty function names if supported.
This doesn't really do much until I have build time hashing.
2015-06-09 00:00:41 +02:00

13 lines
448 B
C++

namespace dk {
template <typename T, uint32_t D>
HashType make_signature_hash() {
#if IS_PRETTY_FUNC_CONSTEXPR
constexpr bt::string<sizeof(__PRETTY_FUNCTION__)-1> func_pretty(__PRETTY_FUNCTION__);
return implem::hash_string(func_pretty.data(), func_pretty.size());
#else
const char* const pf = __PRETTY_FUNCTION__;
const std::size_t len = sizeof(__PRETTY_FUNCTION__) - 1;
return implem::hash_string(pf, len);
#endif
}
} //namespace dk