Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Usage assert(not <condition>)

Reference: std::is_sorted

In the example section of the above link, I see the following usage:

    int data[] = {3, 1, 4, 1, 5};
    assert(not std::is_sorted(std::begin(data), std::end(data)));

I am familiar with the syntax assert(! <condition>)

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

Evidently, assert(not <condition>) is similar, but wanted to know whether it has been documented somewhere in the standard?

TIA

Vin

>Solution :

The words "and", "or", and "not" are acceptable alternatives for the "&", "|" and "!" operators in C++.

https://en.cppreference.com/w/cpp/language/operator_alternative

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading