https://github.com/yzhong52/smart_assertion
Assertion in C++ in a more elegant way.
https://github.com/yzhong52/smart_assertion
Last synced: 6 months ago
JSON representation
Assertion in C++ in a more elegant way.
- Host: GitHub
- URL: https://github.com/yzhong52/smart_assertion
- Owner: yzhong52
- Created: 2013-10-27T19:01:58.000Z (almost 12 years ago)
- Default Branch: master
- Last Pushed: 2014-06-04T22:39:13.000Z (over 11 years ago)
- Last Synced: 2025-02-14T17:55:12.924Z (8 months ago)
- Language: C++
- Homepage:
- Size: 158 KB
- Stars: 0
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
Smart_Assertion
===============Assertion won't give any allerts under release mode, which sometimes might hide potential bugs.
However, we sometime may prefer to develop the project under release mode simply because of running speed.
This smart assertion will give an error message output as red text on terminal.
Notes:
1. This is only compatible under Linux.
2. Its usage is similar to static_assert in C++ 11Sample usage
===============Code
int i = -1;
smart_assert(i>=0 && i<3, "Index out of bound" );Output
Assertion failed: i>0 && i<3
Messages: Index out of bound
Location: file main.cpp, line 17