Changeset 79970ed for src/Common


Ignore:
Timestamp:
Aug 24, 2016, 12:36:33 PM (8 years ago)
Author:
Rob Schluntz <rschlunt@…>
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
Message:

implement warnings for missing struct member constructor calls, remove bad clones

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/Common/utility.h

    rf87408e r79970ed  
    144144
    145145template < typename T >
    146 std::string toString ( T value ) {
     146void toString_single ( std::ostream & os, const T & value ) {
     147        os << value;
     148}
     149
     150template < typename T, typename... Params >
     151void toString_single ( std::ostream & os, const T & value, const Params & ... params ) {
     152        os << value;
     153        toString_single( os, params ... );
     154}
     155
     156template < typename ... Params >
     157std::string toString ( const Params & ... params ) {
    147158        std::ostringstream os;
    148         os << value; // << std::ends;
     159        toString_single( os, params... );
    149160        return os.str();
    150161}
     
    218229}
    219230
     231template< typename T >
     232void warn_single( const T & arg ) {
     233        std::cerr << arg << std::endl;
     234}
     235
     236template< typename T, typename... Params >
     237void warn_single(const T & arg, const Params & ... params ) {
     238        std::cerr << arg;
     239        warn_single( params... );
     240}
     241
     242template< typename... Params >
     243void warn( const Params & ... params ) {
     244        std::cerr << "Warning: ";
     245        warn_single( params... );
     246}
     247
    220248#endif // _UTILITY_H
    221249
Note: See TracChangeset for help on using the changeset viewer.