Changeset 9a1e509 for src/Common
- Timestamp:
- Jul 13, 2017, 3:57:23 PM (8 years ago)
- Branches:
- ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, 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:
- bf30ab3
- Parents:
- 1d776fd (diff), 3d4b23fa (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - Location:
- src/Common
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Common/Assert.cc
r1d776fd r9a1e509 14 14 // 15 15 16 #include <assert.h> 17 #include <cstdarg> // varargs 18 #include <cstdio> // fprintf 19 #include <cstdlib> // abort 16 #include <cstdarg> // for va_end, va_list, va_start 17 #include <cstdio> // for fprintf, stderr, vfprintf 18 #include <cstdlib> // for abort 20 19 21 20 extern const char * __progname; // global name of running executable (argv[0]) -
src/Common/SemanticError.cc
r1d776fd r9a1e509 14 14 // 15 15 16 #include < iostream>17 #include < list>18 #include < string>19 #include < algorithm>20 #include < iterator>16 #include <cstdio> // for fileno, stderr 17 #include <unistd.h> // for isatty 18 #include <iostream> // for basic_ostream, operator<<, ostream 19 #include <list> // for list, _List_iterator 20 #include <string> // for string, operator<<, operator+, to_string 21 21 22 #include "Common/utility.h" // for to_string, CodeLocation (ptr only) 22 23 #include "SemanticError.h" 23 24 #include <unistd.h>25 24 26 25 inline const std::string& error_str() { -
src/Common/SemanticError.h
r1d776fd r9a1e509 17 17 #define SEMANTICERROR_H 18 18 19 #include <exception> 20 #include <string> 21 #include <sstream> 22 #include <list> 23 #include <iostream> 19 #include <exception> // for exception 20 #include <iostream> // for ostream 21 #include <list> // for list 22 #include <string> // for string 24 23 25 #include "utility.h" 24 #include "utility.h" // for CodeLocation, toString 26 25 27 26 struct error { -
src/Common/utility.h
r1d776fd r9a1e509 25 25 #include <sstream> 26 26 #include <string> 27 #include <type_traits> 27 28 28 29 #include <cassert> … … 305 306 // for ( val : group_iterate( container1, container2, ... ) ) {} 306 307 // syntax to have a for each that iterates multiple containers of the same length 307 // TODO: update to use variadic arguments , perfect forwarding308 // TODO: update to use variadic arguments 308 309 309 310 template< typename T1, typename T2 > … … 314 315 315 316 struct iterator { 316 typedef std::tuple<typename T1::value_type, typename T2::value_type> value_type; 317 typedef typename T1::iterator T1Iter; 318 typedef typename T2::iterator T2Iter; 317 typedef typename std::remove_reference<T1>::type T1val; 318 typedef typename std::remove_reference<T2>::type T2val; 319 typedef std::tuple<typename T1val::value_type &, typename T2val::value_type &> value_type; 320 typedef typename T1val::iterator T1Iter; 321 typedef typename T2val::iterator T2Iter; 319 322 typedef std::tuple<T1Iter, T2Iter> IterTuple; 320 323 IterTuple it; … … 324 327 } 325 328 bool operator!=( const iterator &other ) const { return it != other.it; } 326 value_type operator*() const { return std:: make_tuple( *std::get<0>(it), *std::get<1>(it) ); }329 value_type operator*() const { return std::tie( *std::get<0>(it), *std::get<1>(it) ); } 327 330 }; 328 331 iterator begin() { return iterator( std::get<0>(args).begin(), std::get<1>(args).begin() ); } … … 334 337 335 338 template< typename... Args > 336 group_iterate_t<Args...> group_iterate( const Args&... args ) {337 return group_iterate_t<Args...>( args...);339 group_iterate_t<Args...> group_iterate( Args &&... args ) { 340 return group_iterate_t<Args...>(std::forward<Args>( args )...); 338 341 } 339 342
Note:
See TracChangeset
for help on using the changeset viewer.