GuillaumeDua / CppShelf

Collection of powerfuls - C++ Single-Header Libraries Files
https://guillaumedua.github.io/CppShelf/
MIT License
9 stars 1 forks source link

[typeinfo] better storage #224

Open GuillaumeDua opened 4 months ago

GuillaumeDua commented 4 months ago

To avoid common user errors - especially when operating with const char*-based legacy APIs,
make csl::typeinfo::type_name_v<T> == std::string_view{csl::typeinfo::type_name_v<T>.data()}.


💡 C++23 implementation might use constexpr std::string instead of std::string_view, see demo here: https://godbolt.org/z/99Kq6W8ob