Skip to content

Commit

Permalink
🚑 fix for #448
Browse files Browse the repository at this point in the history
  • Loading branch information
nlohmann committed Feb 19, 2017
1 parent 83f1d2c commit 1f72c38
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
6 changes: 4 additions & 2 deletions src/json.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -523,8 +523,10 @@ struct has_to_json
// to_json //
/////////////

template<typename BasicJsonType>
void to_json(BasicJsonType& j, typename BasicJsonType::boolean_t b) noexcept
template<typename BasicJsonType, typename T, enable_if_t<
std::is_same<typename std::decay<T>::type,
typename BasicJsonType::boolean_t>::value, int> = 0>
void to_json(BasicJsonType& j, T b) noexcept
{
external_constructor<value_t::boolean>::construct(j, b);
}
Expand Down
6 changes: 4 additions & 2 deletions src/json.hpp.re2c
Original file line number Diff line number Diff line change
Expand Up @@ -523,8 +523,10 @@ struct has_to_json
// to_json //
/////////////

template<typename BasicJsonType>
void to_json(BasicJsonType& j, typename BasicJsonType::boolean_t b) noexcept
template<typename BasicJsonType, typename T, enable_if_t<
std::is_same<typename std::decay<T>::type,
typename BasicJsonType::boolean_t>::value, int> = 0>
void to_json(BasicJsonType& j, T b) noexcept
{
external_constructor<value_t::boolean>::construct(j, b);
}
Expand Down

0 comments on commit 1f72c38

Please sign in to comment.