Changeset 437
- Timestamp:
- Dec 15, 2005, 9:32:38 AM (17 years ago)
- Location:
- trunk/lib/utility
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/lib/utility/stl_utility.cc
r436 r437 13 13 namespace utility { 14 14 15 16 15 bool read_to_double(std::istream& is, std::vector<double>& vec) 17 16 { … … 82 81 83 82 }} // end of namespace utility and namespace thep 84 -
trunk/lib/utility/stl_utility.h
r436 r437 18 18 19 19 namespace std { 20 20 21 /// 21 22 /// Print out a pair … … 26 27 std::ostream& operator<<(std::ostream& out, const std::pair<T1,T2>& p) 27 28 { out << p.first << "\t" << p.second; return out; } 29 28 30 } 29 31 … … 50 52 } 51 53 }; 52 53 54 54 55 55 /// … … 102 102 } 103 103 104 105 104 /// 106 105 /// Function converting a string to upper case -
trunk/lib/utility/utility.cc
r435 r437 15 15 std::stringstream ss(s); 16 16 double a; 17 if(ss>>a) 18 return 1; 19 else 20 return 0; 17 return (ss>>a); 21 18 } 22 19 … … 25 22 std::stringstream ss(s); 26 23 float a; 27 if(ss>>a) 28 return 1; 29 else 30 return 0; 24 return (ss>>a); 31 25 } 32 26 … … 35 29 std::stringstream ss(s); 36 30 int a; 37 if(ss>>a) 38 return 1; 39 else 40 return 0; 31 return (ss>>a); 41 32 } 42 33 … … 51 42 } 52 43 53 54 44 }} // end of namespace utility and namespace thep
Note: See TracChangeset
for help on using the changeset viewer.