Changes in src/Common/utility.h [2298f728:940bba3]
- File:
-
- 1 edited
-
src/Common/utility.h (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/Common/utility.h
r2298f728 r940bba3 10 10 // Created On : Mon May 18 07:44:20 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Fri Sep 23 11:46:47201613 // Update Count : 2 812 // Last Modified On : Wed Jun 8 17:33:59 2016 13 // Update Count : 22 14 14 // 15 15 … … 25 25 #include <sstream> 26 26 #include <string> 27 #include <cassert>28 27 29 28 template< typename T > … … 102 101 } // if 103 102 } // for 103 } 104 105 static inline std::string assign_strptr( const std::string *str ) { 106 if ( str == 0 ) { 107 return ""; 108 } else { 109 std::string tmp; 110 tmp = *str; 111 delete str; 112 return tmp; 113 } // if 104 114 } 105 115 … … 131 141 132 142 template < typename T > 133 void toString_single ( std::ostream & os, const T & value ) {143 void toString_single ( std::ostream & os, const T & value ) { 134 144 os << value; 135 145 } 136 146 137 147 template < typename T, typename... Params > 138 void toString_single ( std::ostream & os, const T & value, const Params & ... params ) {148 void toString_single ( std::ostream & os, const T & value, const Params & ... params ) { 139 149 os << value; 140 150 toString_single( os, params ... ); … … 142 152 143 153 template < typename ... Params > 144 std::string toString ( const Params & ... params ) {154 std::string toString ( const Params & ... params ) { 145 155 std::ostringstream os; 146 156 toString_single( os, params... );
Note:
See TracChangeset
for help on using the changeset viewer.