overload for void*, fixed amib. for bool

This commit is contained in:
matthias@arch 2022-11-05 20:45:20 +01:00
parent 4a820cb2b2
commit 57f1af36aa

View File

@ -198,7 +198,7 @@ namespace gz {
* @returns std::to_string(t)
*/
template<util::WorksWithStdToString T>
inline std::string toString(const T& t) {
inline std::string toString(const T& t) requires (!std::same_as<T, bool>) {
return std::to_string(t);
}
@ -302,6 +302,15 @@ namespace gz {
inline std::string toString(const T& t) {
return toString(*t);
}
/**
* @overload
* @brief Construct a string from the address of the void*
* @returns toString(reinterpret_cast<uint64_t>(voidPtr))
*/
inline std::string toString(const void* const voidPtr) {
return toString(reinterpret_cast<uint64_t>(voidPtr));
}
} // namespace gz