repr 0.1
Reconstructable string representations and more
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages Concepts
type_info.h
Go to the documentation of this file.
#pragma once
#include <iosfwd>
#include <string>
#include <string_view>
namespace librepr {
template <typename T>
struct TypeName {
/* implicit */ operator std::string() const noexcept { // NOLINT
return to_string();
}
friend std::ostream& operator<<(std::ostream& ctx, TypeName<T> const& obj) { return ctx << obj.to_string(); }
return ctx << obj.to_string();
}
};
} // namespace librepr
namespace librepr::detail {
template <class CharT>
using StrFormatter = REPR_FORMAT_NS::formatter<std::string, CharT>;
} // namespace librepr::detail
// REPR_FORMAT_NS::format support for librepr::TypeName<T>{} and nameof<T>
template <class T, class CharT>
struct REPR_FORMAT_RNS::formatter<librepr::TypeName<T>, CharT> : librepr::detail::StrFormatter<CharT> { // NOLINT
auto format(librepr::TypeName<T> const& obj, auto& ctx) const {
}
};