Changeset 1c80f20 for src/Common
- Timestamp:
- Feb 16, 2023, 3:10:02 PM (20 months ago)
- Branches:
- ADT, ast-experimental, master
- Children:
- f5f2768
- Parents:
- abcb393 (diff), 4b60b28 (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/Common/utility.h
rabcb393 r1c80f20 10 10 // Created On : Mon May 18 07:44:20 2015 11 11 // Last Modified By : Andrew Beach 12 // Last Modified On : Mon Apr 25 14:26:00 202213 // Update Count : 5 112 // Last Modified On : Thr Feb 16 12:35:00 2023 13 // Update Count : 52 14 14 // 15 15 … … 49 49 return 0; 50 50 } // if 51 }52 53 template< typename T, typename U >54 struct maybeBuild_t {55 static T * doit( const U *orig ) {56 if ( orig ) {57 return orig->build();58 } else {59 return 0;60 } // if61 }62 };63 64 template< typename T, typename U >65 static inline T * maybeBuild( const U *orig ) {66 return maybeBuild_t<T,U>::doit(orig);67 }68 69 template< typename T, typename U >70 static inline T * maybeMoveBuild( const U *orig ) {71 T* ret = maybeBuild<T>(orig);72 delete orig;73 return ret;74 51 } 75 52
Note: See TracChangeset
for help on using the changeset viewer.