Changeset dbae916 for src/Parser/parserutility.h
- Timestamp:
- Mar 14, 2023, 4:21:05 PM (3 years ago)
- Branches:
- ADT, ast-experimental, master
- Children:
- 1afd9ccb, 360bfe41, 6e6989c
- Parents:
- 5217569 (diff), c19ca4b (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. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Parser/parserutility.h
r5217569 rdbae916 10 10 // Created On : Sat May 16 15:31:46 2015 11 11 // Last Modified By : Andrew Beach 12 // Last Modified On : Thr Feb 16 12:34:00 202313 // Update Count : 512 // Last Modified On : Thr Mar 9 12:16:00 2023 13 // Update Count : 6 14 14 // 15 15 … … 20 20 Expression *notZeroExpr( Expression *orig ); 21 21 22 template< typename T, typename U > 23 struct maybeBuild_t { 24 static T * doit( const U *orig ) { 25 if ( orig ) { 26 return orig->build(); 27 } else { 28 return 0; 29 } 30 } 31 }; 32 33 template< typename T, typename U > 34 static inline T * maybeBuild( const U *orig ) { 35 return maybeBuild_t<T,U>::doit(orig); 22 template< typename T > 23 static inline auto maybeBuild( const T *orig ) -> decltype(orig->build()) { 24 return (orig) ? orig->build() : nullptr; 36 25 } 37 26 38 template< typename T , typename U>39 static inline T * maybeMoveBuild( const U *orig) {40 T*ret = maybeBuild<T>(orig);27 template< typename T > 28 static inline auto maybeMoveBuild( const T *orig ) -> decltype(orig->build()) { 29 auto ret = maybeBuild<T>(orig); 41 30 delete orig; 42 31 return ret;
Note:
See TracChangeset
for help on using the changeset viewer.