Added explanatory notes for clang on windows

This commit is contained in:
Patrick Urbanke
2024-03-03 11:08:29 +01:00
parent 7f2be9b7cb
commit eaa715362c
4 changed files with 7 additions and 2 deletions
-1
View File
@@ -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
+2
View File
@@ -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
+2
View File
@@ -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