Changeset 79970ed for src/Common
- Timestamp:
- Aug 24, 2016, 12:36:33 PM (8 years ago)
- Branches:
- ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, ctor, deferred_resn, demangler, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, with_gc
- Children:
- 0555f4b
- Parents:
- f87408e
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Common/utility.h
rf87408e r79970ed 144 144 145 145 template < typename T > 146 std::string toString ( T value ) { 146 void toString_single ( std::ostream & os, const T & value ) { 147 os << value; 148 } 149 150 template < typename T, typename... Params > 151 void toString_single ( std::ostream & os, const T & value, const Params & ... params ) { 152 os << value; 153 toString_single( os, params ... ); 154 } 155 156 template < typename ... Params > 157 std::string toString ( const Params & ... params ) { 147 158 std::ostringstream os; 148 os << value; // << std::ends;159 toString_single( os, params... ); 149 160 return os.str(); 150 161 } … … 218 229 } 219 230 231 template< typename T > 232 void warn_single( const T & arg ) { 233 std::cerr << arg << std::endl; 234 } 235 236 template< typename T, typename... Params > 237 void warn_single(const T & arg, const Params & ... params ) { 238 std::cerr << arg; 239 warn_single( params... ); 240 } 241 242 template< typename... Params > 243 void warn( const Params & ... params ) { 244 std::cerr << "Warning: "; 245 warn_single( params... ); 246 } 247 220 248 #endif // _UTILITY_H 221 249
Note: See TracChangeset
for help on using the changeset viewer.