diff --git a/sprout/utility/value_holder/io.hpp b/sprout/utility/value_holder/io.hpp index 4c80c220..583e1cc3 100644 --- a/sprout/utility/value_holder/io.hpp +++ b/sprout/utility/value_holder/io.hpp @@ -10,6 +10,7 @@ #include #include +#include #include #include @@ -18,7 +19,10 @@ namespace sprout { // operator>> // template - inline SPROUT_NON_CONSTEXPR std::basic_istream& + inline SPROUT_NON_CONSTEXPR typename std::enable_if< + !std::is_reference::value, + std::basic_istream& + >::type operator>>(std::basic_istream& lhs, sprout::value_holder& rhs) { if (lhs.good()) { int d = lhs.get(); @@ -32,28 +36,6 @@ namespace sprout { } return lhs; } - template - inline SPROUT_NON_CONSTEXPR std::basic_istream& - operator>>(std::basic_istream& lhs, sprout::value_holder& rhs) { - if (lhs.good()) { - int d = lhs.get(); - if (d == ' ') { - T x; - lhs >> x; - rhs = x; - } else { - if (d == '-') { - d = lhs.get(); - if (d == '-') { - rhs = sprout::value_holder(); - return lhs; - } - } - lhs.setstate(std::ios::failbit); - } - } - return lhs; - } // // operator<< //