This library assumes that <codeclass="computeroutput"><spanclass="identifier">T</span></code>'s
destructor does not throw exceptions. If it does, the behaviour of many operations
on <codeclass="computeroutput"><spanclass="identifier">optional</span><spanclass="special"><</span><spanclass="identifier">T</span><spanclass="special">></span></code> is
undefined.
</p>
<p>
The following mutating operations never throw exceptions:
They forward calls to the corresponding <codeclass="computeroutput"><spanclass="identifier">T</span></code>'s
constructors or assignments (depending on whether the optional object is initialized
or not); so if both <codeclass="computeroutput"><spanclass="identifier">T</span></code>'s constructor
and the assignment provide strong exception safety guarantee, <codeclass="computeroutput"><spanclass="identifier">optional</span><spanclass="special"><</span><spanclass="identifier">T</span><spanclass="special">></span></code>'s assignment
also provides strong exception safety guarantee; otherwise we only get the
basic guarantee. Additionally, if both involved <codeclass="computeroutput"><spanclass="identifier">T</span></code>'s
constructor and the assignment never throw, <codeclass="computeroutput"><spanclass="identifier">optional</span><spanclass="special"><</span><spanclass="identifier">T</span><spanclass="special">></span></code>'s
Unless <codeclass="computeroutput"><spanclass="identifier">T</span></code>'s constructor or assignment
throws, <codeclass="computeroutput"><spanclass="identifier">optional</span><spanclass="special"><</span><spanclass="identifier">T</span><spanclass="special">></span></code> does
not throw anything else on its own. A throw during assignment never changes
the initialization state of any optional object involved:
Unless <codeclass="computeroutput"><spanclass="identifier">swap</span></code> on optional is
customized, its primary implementation forwards calls to <codeclass="computeroutput"><spanclass="identifier">T</span></code>'s
<codeclass="computeroutput"><spanclass="identifier">swap</span></code> or move constructor (depending
on the initialization state of the optional objects). Thus, if both <codeclass="computeroutput"><spanclass="identifier">T</span></code>'s <codeclass="computeroutput"><spanclass="identifier">swap</span></code>
and move constructor never throw, <codeclass="computeroutput"><spanclass="identifier">swap</span></code>
on <codeclass="computeroutput"><spanclass="identifier">optional</span><spanclass="special"><</span><spanclass="identifier">T</span><spanclass="special">></span></code> never
throws. similarly, if both <codeclass="computeroutput"><spanclass="identifier">T</span></code>'s
<codeclass="computeroutput"><spanclass="identifier">swap</span></code> and move constructor offer
strong guarantee, <codeclass="computeroutput"><spanclass="identifier">swap</span></code> on
<codeclass="computeroutput"><spanclass="identifier">optional</span><spanclass="special"><</span><spanclass="identifier">T</span><spanclass="special">></span></code> also
offers a strong guarantee.
</p>
<p>
In case <codeclass="computeroutput"><spanclass="identifier">swap</span></code> on optional is
customized, the call to <codeclass="computeroutput"><spanclass="identifier">T</span></code>'s
move constructor are replaced with the calls to <codeclass="computeroutput"><spanclass="identifier">T</span></code>'s
default constructor followed by <codeclass="computeroutput"><spanclass="identifier">swap</span></code>.
(This is more useful on older compilers that do not support move semantics,
when one wants to acheive stronger exception safety guarantees.) In this case
the exception safety guarantees for <codeclass="computeroutput"><spanclass="identifier">swap</span></code>
are reliant on the guarantees of <codeclass="computeroutput"><spanclass="identifier">T</span></code>'s
<codeclass="computeroutput"><spanclass="identifier">swap</span></code> and default constructor
<tdalign="right"><divclass="copyright-footer">Copyright © 2003-2007 Fernando Luis Cacciola Carballal<br>Copyright © 2014 Andrzej Krzemieński<p>