Turn off exception

I

Immortal Nephi

Can I turn off exception on C++ Compiler’s setting if I use vector
and string in release mode?
I prefer to use assert in debug mode. If index is out of range
bondary in operator[] function, then assert is triggered. Turn off
checking range boundary helps to increase performance in release mode.
 
J

Jonathan Lee

        Can I turn off exception on C++ Compiler’s setting if I use vector
and string in release mode?
        I prefer to use assert in debug mode.  If index is out of range
bondary in operator[] function, then assert is triggered.  Turn off
checking range boundary helps to increase performance in release mode.

vector::eek:perator[] doesn't do bounds checking. vector::at() is the
equivalent function for bounds checking.

As for your question, check in a newsgroup for your compiler. I think
turning off exceptions in general was/is a supported feature of most
compilers.

--Jonathan
 
J

James Kanze

On Jul 27, 12:41 pm, Immortal Nephi <[email protected]>
wrote:
Can I turn off exception on C++ Compiler’s setting if I use vector
and string in release mode?
I prefer to use assert in debug mode. If index is out of range
bondary in operator[] function, then assert is triggered. Turn off
checking range boundary helps to increase performance in release mode.
vector::eek:perator[] doesn't do bounds checking. vector::at() is the
equivalent function for bounds checking.
As for your question, check in a newsgroup for your compiler. I think
turning off exceptions in general was/is a supported feature of most
compilers.

Except that generally speaking, if you turn off exceptions, you
can't use the standard library.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,009
Latest member
GidgetGamb

Latest Threads

Top