2007-05-29 06:40:25 +00:00
< html >
< head >
2011-04-06 20:54:18 +00:00
< meta http-equiv = "Content-Type" content = "text/html; charset=US-ASCII" >
2007-05-29 06:40:25 +00:00
< title > Implementation Notes</ title >
< link rel = "stylesheet" href = "../boostbook.css" type = "text/css" >
2013-02-16 19:42:42 +00:00
< meta name = "generator" content = "DocBook XSL Stylesheets V1.77.1" >
2011-04-06 20:54:18 +00:00
< link rel = "home" href = "../index.html" title = "Chapter 1. Boost.Optional" >
< link rel = "up" href = "../index.html" title = "Chapter 1. Boost.Optional" >
2007-05-29 06:40:25 +00:00
< link rel = "prev" href = "type_requirements.html" title = "Type requirements" >
2009-02-12 14:01:48 +00:00
< link rel = "next" href = "dependencies_and_portability.html" title = "Dependencies and Portability" >
2007-05-29 06:40:25 +00:00
</ head >
< body bgcolor = "white" text = "black" link = "#0000FF" vlink = "#840084" alink = "#0000FF" >
2008-02-14 17:43:52 +00:00
< table cellpadding = "2" width = "100%" >< tr >
< td valign = "top" >< img alt = "Boost C++ Libraries" width = "277" height = "86" src = "../../../../../boost.png" ></ td >
2009-02-12 14:01:48 +00:00
< td align = "center" >< a href = "../../../../../index.html" > Home</ a ></ td >
2011-04-06 20:54:18 +00:00
< td align = "center" >< a href = "../../../../../libs/libraries.htm" > Libraries</ a ></ td >
2009-02-12 14:01:48 +00:00
< td align = "center" >< a href = "http://www.boost.org/users/people.html" > People</ a ></ td >
< td align = "center" >< a href = "http://www.boost.org/users/faq.html" > FAQ</ a ></ td >
2008-02-14 17:43:52 +00:00
< td align = "center" >< a href = "../../../../../more/index.htm" > More</ a ></ td >
</ tr ></ table >
2007-05-29 06:40:25 +00:00
< hr >
< div class = "spirit-nav" >
2011-04-06 20:54:18 +00:00
< a accesskey = "p" href = "type_requirements.html" >< img src = "../../../../../doc/src/images/prev.png" alt = "Prev" ></ a >< a accesskey = "u" href = "../index.html" >< img src = "../../../../../doc/src/images/up.png" alt = "Up" ></ a >< a accesskey = "h" href = "../index.html" >< img src = "../../../../../doc/src/images/home.png" alt = "Home" ></ a >< a accesskey = "n" href = "dependencies_and_portability.html" >< img src = "../../../../../doc/src/images/next.png" alt = "Next" ></ a >
2007-05-29 06:40:25 +00:00
</ div >
2013-02-16 19:42:42 +00:00
< div class = "section boost_optional_implementation_notes" >
2007-05-29 06:40:25 +00:00
< div class = "titlepage" >< div >< div >< h2 class = "title" style = "clear: both" >
2009-02-12 14:01:48 +00:00
< a name = "boost_optional.implementation_notes" ></ a >< a class = "link" href = "implementation_notes.html" title = "Implementation Notes" > Implementation Notes</ a >
2007-05-29 06:40:25 +00:00
</ h2 ></ div ></ div ></ div >
< p >
< code class = "computeroutput" >< span class = "identifier" > optional</ span >< span class = "special" > < </ span >< span class = "identifier" > T</ span >< span class = "special" > > </ span ></ code > is
currently implemented using a custom aligned storage facility built from < code class = "computeroutput" >< span class = "identifier" > alignment_of</ span ></ code > and < code class = "computeroutput" >< span class = "identifier" > type_with_alignment</ span ></ code >
(both from Type Traits). It uses a separate boolean flag to indicate the initialization
state. Placement new with < code class = "computeroutput" >< span class = "identifier" > T</ span ></ code > 's
copy constructor and < code class = "computeroutput" >< span class = "identifier" > T</ span ></ code > 's destructor
are explicitly used to initialize,copy and destroy optional values. As a result,
< code class = "computeroutput" >< span class = "identifier" > T</ span ></ code > 's default constructor is
effectively by-passed, but the exception guarantees are basic. It is planned
to replace the current implementation with another with stronger exception
safety, such as a future < code class = "computeroutput" >< span class = "identifier" > boost</ span >< span class = "special" > ::</ span >< span class = "identifier" > variant</ span ></ code > .
</ p >
</ div >
< table xmlns:rev = "http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width = "100%" >< tr >
< td align = "left" ></ td >
2011-04-06 20:54:18 +00:00
< td align = "right" >< div class = "copyright-footer" > Copyright © 2003-2007 Fernando Luis Cacciola Carballal< p >
2008-02-14 17:43:52 +00:00
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at < a href = "http://www.boost.org/LICENSE_1_0.txt" target = "_top" > http://www.boost.org/LICENSE_1_0.txt</ a > )
</ p >
</ div ></ td >
2007-05-29 06:40:25 +00:00
</ tr ></ table >
< hr >
< div class = "spirit-nav" >
2011-04-06 20:54:18 +00:00
< a accesskey = "p" href = "type_requirements.html" >< img src = "../../../../../doc/src/images/prev.png" alt = "Prev" ></ a >< a accesskey = "u" href = "../index.html" >< img src = "../../../../../doc/src/images/up.png" alt = "Up" ></ a >< a accesskey = "h" href = "../index.html" >< img src = "../../../../../doc/src/images/home.png" alt = "Home" ></ a >< a accesskey = "n" href = "dependencies_and_portability.html" >< img src = "../../../../../doc/src/images/next.png" alt = "Next" ></ a >
2007-05-29 06:40:25 +00:00
</ div >
</ body >
</ html >