Changeset 1392:b87aa8f0feb8 in lemon-0.x for src/lemon/xy.h
- Timestamp:
- 04/27/05 12:37:03 (20 years ago)
- Branch:
- default
- Phase:
- public
- Convert:
- svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@1849
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/lemon/xy.h
r1391 r1392 160 160 /// 161 161 template<typename T> 162 inline 163 std::istream& operator>>(std::istream &is, xy<T> &z) 164 { 165 166 is >> z.x >> z.y; 162 inline std::istream& operator>>(std::istream &is, xy<T> &z) { 163 char c; 164 if (is >> c) { 165 if (c != '(') is.putback(c); 166 } else { 167 is.clear(); 168 } 169 if (!(is >> z.x)) return is; 170 if (is >> c) { 171 if (c != ',') is.putback(c); 172 } else { 173 is.clear(); 174 } 175 if (!(is >> z.y)) return is; 176 if (is >> c) { 177 if (c != ')') is.putback(c); 178 } else { 179 is.clear(); 180 } 167 181 return is; 168 182 } … … 174 188 /// 175 189 template<typename T> 176 inline 177 std::ostream& operator<<(std::ostream &os, xy<T> z) 190 inline std::ostream& operator<<(std::ostream &os, const xy<T>& z) 178 191 { 179 192 os << "(" << z.x << ", " << z.y << ")";
Note: See TracChangeset
for help on using the changeset viewer.