Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
このコード例では:
explicit MyClass(std::wstring text) noexcept;
ここの使い方はnoexcept正しいですか?wstring構築時にスローされる可能性がありますが、コンストラクターにいる前またはコンストラクターにいる間にスローが発生しますか?
noexcept
wstring
編集:これは、値渡しのパラメーターを取る任意の関数に一般化できるとします。
関数パラメーターの構築と破棄は、呼び出し元のコンテキストで発生します。いいえ、textスローの構築であれば、それは違反ではありませんnoexcept。
text
すぐに人々はコメントして仕様の引用を求めるでしょう:)それで私はあなたに5.2.2p4をあげます
各パラメーターの初期化と破棄は、呼び出し元の関数のコンテキスト内で発生します。