Changeset 21a44ca for src/include/cassert
- Timestamp:
- May 23, 2019, 6:24:18 PM (5 years ago)
- Branches:
- ADT, arm-eh, ast-experimental, cleanup-dtors, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, pthread-emulation, qualifiedEnum
- Children:
- 6f4b7f2, d908563
- Parents:
- 94b1f718 (diff), f1ec88a (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/include/cassert
r94b1f718 r21a44ca 9 9 // Author : Peter A. Buhr 10 10 // Created On : Thu Aug 18 13:19:26 2016 11 // Last Modified By : Peter A. Buhr12 // Last Modified On : T ue Aug 1 11:56:01201713 // Update Count : 1 611 // Last Modified By : Andrew Beach 12 // Last Modified On : Thu May 23 15:30:00 2017 13 // Update Count : 17 14 14 // 15 15 … … 43 43 #endif 44 44 45 template<typename T, typename U> 46 static inline __attribute__((nonnull)) T strict_dynamic_cast( const U & src ) { 45 enum StrictAllowNull {NonNull, AllowNull}; 46 47 template<typename T, StrictAllowNull nullable = NonNull, typename U> 48 static inline T strict_dynamic_cast( const U & src ) { 49 if (nullable == AllowNull && src == nullptr) { 50 return nullptr; 51 } 47 52 assert(src); 48 53 T ret = dynamic_cast<T>(src);
Note: See TracChangeset
for help on using the changeset viewer.