Open ferdymercury opened 4 years ago
As assert() functions does not get called in release mode by default.
Simple solution could be:
#define ASSERT(e) ((e) ? (void)0 : ((void)printf ("%s:%u: failed assertion `%s'\n", FILE, LINE, #e), abort())))
Or with throw std::runtime_error
throw std::runtime_error
Other options: https://stackoverflow.com/questions/620892/how-to-put-assert-into-release-builds-in-c-c https://www.softwariness.com/articles/assertions-in-cpp/ http://www.drdobbs.com/assertions/184403861 https://developer.apple.com/swift/blog/?id=4
As assert() functions does not get called in release mode by default.
Simple solution could be:
Or with
throw std::runtime_error
Other options: https://stackoverflow.com/questions/620892/how-to-put-assert-into-release-builds-in-c-c https://www.softwariness.com/articles/assertions-in-cpp/ http://www.drdobbs.com/assertions/184403861 https://developer.apple.com/swift/blog/?id=4