mirror of
https://codeberg.org/DawnMagnet/reflect-cpp
synced 2026-12-03 00:26:19 +08:00
Added explanatory notes for clang on windows
This commit is contained in:
@@ -21,7 +21,6 @@ Design principles for reflect-cpp include:
|
||||
- Simple installation: If no JSON support is required, reflect-cpp is header-only. For JSON support, only a single source file needs to be compiled.
|
||||
- Simple extendability to other serialization formats
|
||||
- Simple extendability to custom classes
|
||||
- Standard C++ only, no compiler-specific macros
|
||||
|
||||
## Serialization formats
|
||||
|
||||
|
||||
@@ -7,9 +7,9 @@
|
||||
|
||||
#include "../../Literal.hpp"
|
||||
#include "../../define_literal.hpp"
|
||||
#include "../../internal/remove_namespaces.hpp"
|
||||
#include "Names.hpp"
|
||||
#include "is_scoped_enum.hpp"
|
||||
#include "../../internal/remove_namespaces.hpp"
|
||||
|
||||
// https://en.cppreference.com/w/cpp/language/static_cast:
|
||||
|
||||
@@ -41,6 +41,8 @@ namespace enums {
|
||||
|
||||
template <auto e>
|
||||
consteval auto get_enum_name_str_view() {
|
||||
// Unfortunately, we cannot avoid the use of a compiler-specific macro for
|
||||
// Clang on Windows. For all other compilers, function_name works as intended.
|
||||
#if defined(__clang__) && defined(_MSC_VER)
|
||||
const auto func_name = std::string_view{__PRETTY_FUNCTION__};
|
||||
#else
|
||||
|
||||
@@ -43,6 +43,8 @@ constexpr auto wrap(const T& arg) noexcept {
|
||||
|
||||
template <class T, auto ptr>
|
||||
consteval auto get_field_name_str_view() {
|
||||
// Unfortunately, we cannot avoid the use of a compiler-specific macro for
|
||||
// Clang on Windows. For all other compilers, function_name works as intended.
|
||||
#if defined(__clang__) && defined(_MSC_VER)
|
||||
const auto func_name = std::string_view{__PRETTY_FUNCTION__};
|
||||
#else
|
||||
|
||||
@@ -10,6 +10,8 @@ namespace internal {
|
||||
|
||||
template <class T>
|
||||
consteval auto get_type_name_str_view() {
|
||||
// Unfortunately, we cannot avoid the use of a compiler-specific macro for
|
||||
// Clang on Windows. For all other compilers, function_name works as intended.
|
||||
#if defined(__clang__) && defined(_MSC_VER)
|
||||
const auto func_name = std::string_view{__PRETTY_FUNCTION__};
|
||||
#else
|
||||
|
||||
Reference in New Issue
Block a user