Skip to content

Commit

Permalink
Fix ambiguity in value_traits partial specializations for float.
Browse files Browse the repository at this point in the history
Fixes #83.
  • Loading branch information
skystrife committed Aug 21, 2018
1 parent fb39c14 commit 13fb18e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
3 changes: 3 additions & 0 deletions examples/conversions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,5 +53,8 @@ int main()

root->get_as<int64_t>("medium-negative");

root->insert("float", 0.1f);
root->get_as<double>("float");

return 0;
}
1 change: 1 addition & 0 deletions include/cpptoml.h
Original file line number Diff line number Diff line change
Expand Up @@ -331,6 +331,7 @@ template <class T>
struct value_traits<
T, typename std::enable_if<
!valid_value_or_string_convertible<T>::value
&& !std::is_floating_point<typename std::decay<T>::type>::value
&& std::is_signed<typename std::decay<T>::type>::value>::type>
{
using value_type = int64_t;
Expand Down

0 comments on commit 13fb18e

Please sign in to comment.