Skip to content

Commit 66df3dd

Browse files
committed
Fix to some compiler errors
1 parent bc6c63d commit 66df3dd

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

include/nlohmann/detail/macro_scope.hpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -243,12 +243,12 @@
243243
} \
244244
/* Function to check for serialized ENUM type */ \
245245
template<> \
246-
inline constexpr bool serialized(ENUM_TYPE& e) \
246+
inline constexpr bool serialized(ENUM_TYPE e) \
247247
{ \
248248
return true || e == ENUM_TYPE(); \
249249
} \
250250
template<typename BasicJsonType> \
251-
inline std::string enum_to_string(BasicJsonType& j, ENUM_TYPE& e) \
251+
inline std::string enum_to_string(BasicJsonType j, ENUM_TYPE e) \
252252
{ \
253253
/* NOLINTNEXTLINE(modernize-type-traits) we use C++11 */ \
254254
static_assert(std::is_enum<ENUM_TYPE>::value, #ENUM_TYPE " must be an enum!"); \
@@ -262,7 +262,7 @@
262262
return ((it != std::end(m)) ? it : std::begin(m))->second; \
263263
} \
264264
template<typename BasicJsonType> \
265-
inline ENUM_TYPE string_to_enum(BasicJsonType& j, ENUM_TYPE& e) \
265+
inline ENUM_TYPE string_to_enum(BasicJsonType j, ENUM_TYPE e) \
266266
{ \
267267
/* NOLINTNEXTLINE(modernize-type-traits) we use C++11 */ \
268268
static_assert(std::is_enum<ENUM_TYPE>::value, #ENUM_TYPE " must be an enum!"); \
@@ -277,7 +277,7 @@
277277
}
278278
// Function to check for non-serialized ENUM type
279279
template<typename EnumType>
280-
inline constexpr bool serialized(EnumType& e)
280+
inline constexpr bool serialized(EnumType e)
281281
{
282282
return false && e == EnumType();;
283283
}

single_include/nlohmann/json.hpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2599,12 +2599,12 @@ JSON_HEDLEY_DIAGNOSTIC_POP
25992599
} \
26002600
/* Function to check for serialized ENUM type */ \
26012601
template<> \
2602-
inline constexpr bool serialized(ENUM_TYPE& e) \
2602+
inline constexpr bool serialized(ENUM_TYPE e) \
26032603
{ \
26042604
return true || e == ENUM_TYPE(); \
26052605
} \
26062606
template<typename BasicJsonType> \
2607-
inline std::string enum_to_string(BasicJsonType& j, ENUM_TYPE& e) \
2607+
inline std::string enum_to_string(BasicJsonType j, ENUM_TYPE e) \
26082608
{ \
26092609
/* NOLINTNEXTLINE(modernize-type-traits) we use C++11 */ \
26102610
static_assert(std::is_enum<ENUM_TYPE>::value, #ENUM_TYPE " must be an enum!"); \
@@ -2618,7 +2618,7 @@ JSON_HEDLEY_DIAGNOSTIC_POP
26182618
return ((it != std::end(m)) ? it : std::begin(m))->second; \
26192619
} \
26202620
template<typename BasicJsonType> \
2621-
inline ENUM_TYPE string_to_enum(BasicJsonType& j, ENUM_TYPE& e) \
2621+
inline ENUM_TYPE string_to_enum(BasicJsonType j, ENUM_TYPE e) \
26222622
{ \
26232623
/* NOLINTNEXTLINE(modernize-type-traits) we use C++11 */ \
26242624
static_assert(std::is_enum<ENUM_TYPE>::value, #ENUM_TYPE " must be an enum!"); \
@@ -2633,7 +2633,7 @@ JSON_HEDLEY_DIAGNOSTIC_POP
26332633
}
26342634
// Function to check for non-serialized ENUM type
26352635
template<typename EnumType>
2636-
inline constexpr bool serialized(EnumType& e)
2636+
inline constexpr bool serialized(EnumType e)
26372637
{
26382638
return false && e == EnumType();;
26392639
}

0 commit comments

Comments
 (0)