Changeset 9feb34b for src/Common


Ignore:
Timestamp:
Mar 29, 2023, 11:07:03 AM (14 months ago)
Author:
Andrew Beach <ajbeach@…>
Branches:
ADT, ast-experimental, master
Children:
afdb74b
Parents:
60380a1
Message:

Moved toString and toCString to a new header. Updated includes. cassert was somehow getting instances of toString before but that stopped working so I embedded the new smaller include.

Location:
src/Common
Files:
1 added
4 edited

Legend:

Unmodified
Added
Removed
  • src/Common/DeclStats.cpp

    r60380a1 r9feb34b  
    2323#include <iostream>
    2424#include <map>
     25#include <sstream>
    2526#include <unordered_map>
    2627#include <unordered_set>
  • src/Common/ResolvProtoDump.cpp

    r60380a1 r9feb34b  
    1919#include <iostream>
    2020#include <set>
     21#include <sstream>
    2122#include <unordered_set>
    2223
     
    2627#include "AST/Type.hpp"
    2728#include "CodeGen/OperatorTable.h"
    28 #include "Common/utility.h"
    2929
    3030namespace {
  • src/Common/module.mk

    r60380a1 r9feb34b  
    5252        Common/Stats/Time.cc \
    5353        Common/Stats/Time.h \
     54        Common/ToString.hpp \
    5455        Common/UniqueName.cc \
    5556        Common/UniqueName.h \
  • src/Common/utility.h

    r60380a1 r9feb34b  
    2222#include <list>
    2323#include <memory>
    24 #include <sstream>
    2524#include <string>
    2625#include <type_traits>
     
    143142        dst.swap( src );
    144143}
    145 
    146 template < typename T >
    147 void toString_single( std::ostream & os, const T & value ) {
    148         os << value;
    149 }
    150 
    151 template < typename T, typename... Params >
    152 void toString_single( std::ostream & os, const T & value, const Params & ... params ) {
    153         os << value;
    154         toString_single( os, params ... );
    155 }
    156 
    157 template < typename ... Params >
    158 std::string toString( const Params & ... params ) {
    159         std::ostringstream os;
    160         toString_single( os, params... );
    161         return os.str();
    162 }
    163 
    164 #define toCString( ... ) toString( __VA_ARGS__ ).c_str()
    165144
    166145template< typename... Args >
Note: See TracChangeset for help on using the changeset viewer.