noexcept operator (C + + 11以来)
提供:cppreference.com
|
|
This page has been machine-translated from the English version of the wiki using Google Translate.
The translation may contain errors and awkward wording. Hover over text to see the original version. You can help to fix errors and improve the translation. For instructions click here. |
noexcept演算子は、式が例外をスローしないように宣言されていればtrueを返し、コンパイル時のチェックが実行されます.Original:
The
noexcept operator performs a compile-time check that returns true if an expression is declared to not throw any exceptions.The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
それは、関数がいくつかの種類ではなく、他人のために例外をスローすることを宣言するには、関数テンプレートの<div class="t-tr-text"> noexcept指定子
内で使用することができます.Original:
noexcept specifier
The text has been machine-translated via [http://translate.google.com Google Translate].
You can help to correct and verify the translation. Click [http://en.cppreference.com/w/Cppreference:MachineTranslations here] for instructions.
You can help to correct and verify the translation. Click [http://en.cppreference.com/w/Cppreference:MachineTranslations here] for instructions.
Original:
It can be used within a function template's
noexcept指定子</div> to declare that the function will throw exceptions for some types but not others.
Original:
noexcept specifier
The text has been machine-translated via [http://translate.google.com Google Translate].
You can help to correct and verify the translation. Click [http://en.cppreference.com/w/Cppreference:MachineTranslations here] for instructions.
You can help to correct and verify the translation. Click [http://en.cppreference.com/w/Cppreference:MachineTranslations here] for instructions.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
目次 |
[編集] 構文
noexcept( expression )
|
|||||||||
タイプboolのオブジェクトを返します.
Original:
Returns an object of type bool.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
[編集] 説明
noexcept演算子はexpressionを評価しません。 falseは以下の潜在的に評価した構築物の少なくともいずれかを含有する場合、結果はexpressionとおりですOriginal:
The
noexcept operator does not evaluate expression. The result is false if the expression contains at least one of the following potentially evaluated constructs:The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
- でない限り、非例外をスローする仕様を持たない関数の任意の型に呼び出し.Original:call to any type of function that does not have non-throwing exception specification, unless it is a定数式</div>.Original:constant expressionThe text has been machine-translated via [http://translate.google.com Google Translate].
You can help to correct and verify the translation. Click [http://en.cppreference.com/w/Cppreference:MachineTranslations here] for instructions.The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions. -
throw式Original:throwexpressionThe text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions. -
dynamic_cast変換は、実行時チェックを必要とする式Original:dynamic_castexpression when the conversion needs a run time checkThe text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions. -
typeid式の引数の型がポリモーフィックなクラス型である場合Original:typeidexpression when argument type is polymorphic class typeThe text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
- でない限り、非例外をスローする仕様を持たない関数の任意の型に呼び出し.
他のすべての場合では、結果は
trueです.Original:
In all other cases the result is
true.The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
[編集] キーワード
[編集] 例
template <class T> void self_assign(T& t) noexcept(noexcept(T::operator=)) { // self_assign is noexcept if and only if T::operator= is noexcept t = t; }
[編集] も参照してください
| noexcept指定子 | どんな例外(C++11)をスローしないようにする機能を必要とします
Original: requires a function to not throw any exceptions (C++11) The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. |
| 例外仕様 | 例外は関数(廃止予定)によってスローされるかを指定します
Original: specifies what exceptions are thrown by a function (廃止予定) The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. |