I know the use of assert
in C++. Wanted to know is there any difference between and any benefit(I think assert
is costlier according as mentioned in https://www.learncpp.com/cpp-tutorial/7-12a-assert-and-static_assert/ so performance wise, are both same?) in using gsl_assert
over assert
? Why gsl_assert
was added in gsl library since there is already assert
support in c++(even though assert
came from 'C', since we add #include<cassert>
for using assert
in C++)?
#include <iostream>
#include <gsl/gsl_assert>
using namespace std;
int main()
{
int val;
cin >> val;
Ensures( val > 5 );
return 0;
}
using namespace std;
is considered bad practice. – Irreligious