Turn off exception

Discussion in 'C++' started by Immortal Nephi, Jul 27, 2010.

  1. 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.
    Immortal Nephi, Jul 27, 2010
    #1
    1. Advertising

  2. Immortal Nephi

    Jonathan Lee Guest

    On Jul 27, 12:41 pm, Immortal Nephi <>
    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.

    --Jonathan
    Jonathan Lee, Jul 27, 2010
    #2
    1. Advertising

  3. Immortal Nephi

    James Kanze Guest

    On Jul 27, 5:57 pm, Jonathan Lee <> wrote:
    > On Jul 27, 12:41 pm, Immortal Nephi <>
    > 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.

    --
    James Kanze
    James Kanze, Jul 30, 2010
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Kevin Spencer
    Replies:
    2
    Views:
    438
    Cheung, Jeffrey Jing-Yen
    Jul 8, 2003
  2. Andy Crawford

    How to turn Strict "off"?

    Andy Crawford, Jul 10, 2003, in forum: ASP .Net
    Replies:
    1
    Views:
    514
    Cowboy \(Gregory A. Beamer\)
    Jul 11, 2003
  3. robert112
    Replies:
    1
    Views:
    425
    Juan T. Llibre
    Apr 26, 2007
  4. mk
    Replies:
    0
    Views:
    195
  5. Paul Rubin
    Replies:
    6
    Views:
    904
    Peter Otten
    Feb 12, 2010
Loading...

Share This Page