Changeset e04ef3a for src/Common
- Timestamp:
- Jun 14, 2016, 12:53:03 PM (8 years ago)
- Branches:
- ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, ctor, deferred_resn, demangler, enum, forall-pointer-decay, gc_noraii, jacob/cs343-translation, jenkins-sandbox, master, memory, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, with_gc
- Children:
- c8c03683
- Parents:
- 55ba7339
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Common/utility.h
r55ba7339 re04ef3a 9 9 // Author : Richard C. Bilson 10 10 // Created On : Mon May 18 07:44:20 2015 11 // Last Modified By : Rob Schluntz12 // Last Modified On : Thu Apr 28 13:18:24201613 // Update Count : 1611 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Wed Jun 8 17:33:59 2016 13 // Update Count : 22 14 14 // 15 15 … … 33 33 } 34 34 35 template<typename T, typename U> 36 struct maybeBuild_t { 37 static T * doit( const U *orig ) { 38 if ( orig ) { 39 return orig->build(); 40 } else { 41 return 0; 42 } // if 43 } 44 }; 45 35 46 template< typename T, typename U > 36 47 static inline T * maybeBuild( const U *orig ) { 37 if ( orig ) { 38 return orig->build(); 39 } else { 40 return 0; 41 } // if 48 return maybeBuild_t<T,U>::doit(orig); 42 49 } 43 50
Note: See TracChangeset
for help on using the changeset viewer.