Namespaces
Variants
Views
Actions

noexcept operator [[:Template:mark c++11 feature]]

From cppreference.com
< cpp‎ | language
Revision as of 05:39, 9 November 2011 by P12 (Talk | contribs)

Template:cpp/language/sidebar Checks whether the evaluation of an expression can throw an exception

Used within noexcept specifier when the fact if the function can throw depends on template parameters.

Contents

Syntax

noexcept( Template:sparam )

Returns an object of type Template:cpp.

Explanation

The noexcept operator does not evaluate Template:sparam. The result is false if the Template:sparam contains at least one of the following potentially evaluated constructs:

  • call to any type of function, which does not have non-throwing exception specification, unless it is a constant expression.
  • throw expression
  • dynamic_cast expression when the conversion needs a run time check
  • typeid expression when argument type is polymorphic class type

On all other cases the result is true

Keywords

noexcept

Example

Template:example cpp

See also