Skip to content

Commit

Permalink
sstring: add iostream input (>>)
Browse files Browse the repository at this point in the history
Signed-off-by: Calle Wilund <calle@cloudius-systems.com>
  • Loading branch information
elcallio authored and avikivity committed Apr 29, 2015
1 parent 066a37a commit 03da739
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions core/sstring.hh
Original file line number Diff line number Diff line change
Expand Up @@ -513,6 +513,17 @@ operator<<(std::basic_ostream<char_type, char_traits>& os,
return os.write(s.begin(), s.size());
}

template <typename char_type, typename size_type, size_type max_size, typename char_traits>
inline
std::basic_istream<char_type, char_traits>&
operator>>(std::basic_istream<char_type, char_traits>& is,
basic_sstring<char_type, size_type, max_size>& s) {
std::string tmp;
is >> tmp;
s = tmp;
return is;
}

namespace std {

template <typename char_type, typename size_type, size_type max_size>
Expand Down

0 comments on commit 03da739

Please sign in to comment.