Changeset b067d9b for src/include/cassert
- Timestamp:
- Oct 29, 2019, 4:01:24 PM (6 years ago)
- Branches:
- ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, pthread-emulation, qualifiedEnum
- Children:
- 773db65, 9421f3d8
- Parents:
- 7951100 (diff), 8364209 (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
-
src/include/cassert (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/include/cassert
r7951100 rb067d9b 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 : Tue Aug 1 11:56:01201713 // Update Count : 1 611 // Last Modified By : Andrew Beach 12 // Last Modified On : Mon Jun 3 13:11:00 2017 13 // Update Count : 18 14 14 // 15 15 … … 19 19 20 20 #include_next <cassert> 21 22 #include <string> 23 24 template < typename ... Params > 25 std::string toString( const Params & ... params ); 21 26 22 27 #ifdef NDEBUG … … 40 45 template<typename T, typename U> 41 46 static inline T strict_dynamic_cast( const U & src ) { 47 assert(src); 42 48 T ret = dynamic_cast<T>(src); 43 49 assertf(ret, "%s", toString(src).c_str()); … … 45 51 } 46 52 53 template<typename T, decltype(nullptr) null, typename U> 54 static inline T strict_dynamic_cast( const U & src ) { 55 return src ? strict_dynamic_cast<T, U>( src ) : nullptr; 56 } 57 58 extern void abort(const char *fmt, ... ) noexcept __attribute__((noreturn, format(printf, 1, 2))); 47 59 // Local Variables: // 48 60 // tab-width: 4 //
Note:
See TracChangeset
for help on using the changeset viewer.