Skip to content

Instantly share code, notes, and snippets.

@iamalbert
iamalbert / Assert.hpp
Last active June 5, 2022 04:51
C++ SMART ASSERT
#define __ASSERT1__(x) __REPORT__(x).__ASSERT2__
#define __ASSERT2__(x) __REPORT__(x).__ASSERT1__
#define __REPORT__(x) report(#x,(x))
#define ASSERT(cond, msg) if(!(cond)) Assert(#cond,msg,__FILE__,__LINE__).__ASSERT1__
#include <iostream>
struct Assert {
template<class T>