2007-05-29 06:40:25 +00:00
|
|
|
[library Boost.Optional
|
|
|
|
[quickbook 1.4]
|
|
|
|
[authors [Cacciola Carballal, Fernando Luis]]
|
|
|
|
[copyright 2003-2007 Fernando Luis Cacciola Carballal]
|
2014-05-05 19:08:11 +02:00
|
|
|
[copyright 2014 Andrzej Krzemieński]
|
2007-05-29 06:40:25 +00:00
|
|
|
[category miscellaneous]
|
|
|
|
[id optional]
|
|
|
|
[dirname optional]
|
|
|
|
[purpose
|
|
|
|
Discriminated-union wrapper for optional values
|
|
|
|
]
|
|
|
|
[source-mode c++]
|
|
|
|
[license
|
|
|
|
Distributed under the Boost Software License, Version 1.0.
|
|
|
|
(See accompanying file LICENSE_1_0.txt or copy at
|
|
|
|
[@http://www.boost.org/LICENSE_1_0.txt])
|
|
|
|
]
|
|
|
|
]
|
|
|
|
|
|
|
|
[/ Macros will be used for links so we have a central place to change them ]
|
|
|
|
|
|
|
|
|
|
|
|
[/ Cited Boost resources ]
|
|
|
|
|
|
|
|
[def __BOOST_VARIANT__ [@../../../variant/index.html Boost.Variant]]
|
Merge in documentation fixes. Apart from the change to optional's documenation
Jamfile, which I included by mistake.
Fixes #1659, #1661, #1684, #1685, 1687, #1690, #1801
I wrote about this at:
http://lists.boost.org/Archives/boost/2008/04/136405.php
Merged revisions 44585-44806 via svnmerge from
https://svn.boost.org/svn/boost/branches/doc
........
r44585 | danieljames | 2008-04-19 16:25:27 +0100 (Sat, 19 Apr 2008) | 2 lines
Fix broken link to vacpp in bjam docs. Refs #1512
........
r44586 | danieljames | 2008-04-19 16:27:36 +0100 (Sat, 19 Apr 2008) | 2 lines
Fix broken link to bcpp in bjam docs. Refs #1513
........
r44587 | danieljames | 2008-04-19 16:33:58 +0100 (Sat, 19 Apr 2008) | 2 lines
DateTime documentation - Fix a link to the serialization library. Refs #1659
........
r44588 | danieljames | 2008-04-19 16:35:36 +0100 (Sat, 19 Apr 2008) | 2 lines
Fix some links in interprocess & intrusive. Refs #1661
........
r44589 | danieljames | 2008-04-19 16:37:39 +0100 (Sat, 19 Apr 2008) | 2 lines
Fix some links in the python docs. Refs #1684.
........
r44590 | danieljames | 2008-04-19 16:38:29 +0100 (Sat, 19 Apr 2008) | 2 lines
Work around a quickbook bug which is affecting the python docs. Refs #1684.
........
r44591 | danieljames | 2008-04-19 16:39:34 +0100 (Sat, 19 Apr 2008) | 2 lines
Fix a broken link in the numeric conversion docs. Refs #1685
........
r44592 | danieljames | 2008-04-19 16:40:45 +0100 (Sat, 19 Apr 2008) | 2 lines
Fix some links in the optional docs. Refs #1687
........
r44593 | danieljames | 2008-04-19 16:42:09 +0100 (Sat, 19 Apr 2008) | 2 lines
Fix link to the hash documentation from bimap. Refs #1690
........
r44599 | danieljames | 2008-04-19 18:07:33 +0100 (Sat, 19 Apr 2008) | 2 lines
Fix a typo in the format library. Refs #1801
........
r44600 | danieljames | 2008-04-19 19:20:59 +0100 (Sat, 19 Apr 2008) | 1 line
Initialise svnmerge.
........
r44641 | danieljames | 2008-04-20 18:59:47 +0100 (Sun, 20 Apr 2008) | 2 lines
Fix the lincense url in shared container iterator documentation.
........
r44642 | danieljames | 2008-04-20 19:00:00 +0100 (Sun, 20 Apr 2008) | 2 lines
Fix image link in the mpi documentation.
........
r44643 | danieljames | 2008-04-20 19:00:11 +0100 (Sun, 20 Apr 2008) | 2 lines
Fix a typo in the spirit docs.
........
r44644 | danieljames | 2008-04-20 19:00:23 +0100 (Sun, 20 Apr 2008) | 2 lines
Escape the slash so that quickbook doesn't think it the start of an italic section, and mess up the link. Refs #1844
........
r44647 | danieljames | 2008-04-20 19:39:47 +0100 (Sun, 20 Apr 2008) | 2 lines
Fix another typo in spirit docs.
........
[SVN r44807]
2008-04-27 07:39:49 +00:00
|
|
|
[def __BOOST_TRIBOOL__ [@../../../../doc/html/tribool.html boost::tribool]]
|
2007-05-29 06:40:25 +00:00
|
|
|
|
|
|
|
[def __OPTIONAL_POINTEE__ [@../../../utility/OptionalPointee.html OptionalPointee]]
|
|
|
|
[def __COPY_CONSTRUCTIBLE__ [@../../../utility/CopyConstructible.html Copy Constructible]]
|
|
|
|
[def __FUNCTION_EQUAL_POINTEES__ [@../../../utility/OptionalPointee.html#equal `equal_pointees()`]]
|
|
|
|
[def __FUNCTION_LESS_POINTEES__ [@../../../utility/OptionalPointee.html#less `less_pointees()`]]
|
|
|
|
|
|
|
|
[def __IN_PLACE_FACTORY_HPP__ [@../../../../boost/utility/in_place_factory.hpp in_place_factory.hpp]]
|
|
|
|
[def __TYPED_IN_PLACE_FACTORY_HPP__ [@../../../../boost/utility/typed_in_place_factory.hpp typed_in_place_factory.hpp]]
|
|
|
|
|
|
|
|
[/ Other web resources ]
|
|
|
|
|
|
|
|
[def __HASKELL__ [@http://www.haskell.org/ Haskell]]
|
|
|
|
[def __SGI_DEFAULT_CONSTRUCTIBLE__ [@http://www.sgi.com/tech/stl/DefaultConstructible.html Default Constructible]]
|
|
|
|
|
|
|
|
|
|
|
|
[/ Icons ]
|
|
|
|
|
|
|
|
[def __SPACE__ [$images/space.png]]
|
|
|
|
[def __GO_TO__ [$images/callouts/R.png]]
|
|
|
|
|
|
|
|
|
2014-05-07 17:07:12 +02:00
|
|
|
[section Introduction]
|
2014-05-08 21:50:41 +02:00
|
|
|
This library can be used to represent 'optional' (or 'nullable') objects that can be safely passed by value:
|
2007-05-29 06:40:25 +00:00
|
|
|
|
2014-05-07 17:07:12 +02:00
|
|
|
optional<int> readInt(); // this function may return either an int or a not-an-int
|
2007-05-29 06:40:25 +00:00
|
|
|
|
2014-05-07 17:07:12 +02:00
|
|
|
if (optional<int> oi = readInt()) // did I get a real int
|
|
|
|
cout << "my int is: " << *oi; // use my int
|
|
|
|
else
|
|
|
|
cout << "I have no int";
|
|
|
|
|
|
|
|
[endsect]
|
2007-05-29 06:40:25 +00:00
|
|
|
|
2014-05-07 17:07:12 +02:00
|
|
|
[include motivation.qbk]
|
2007-05-29 06:40:25 +00:00
|
|
|
[include development.qbk]
|
|
|
|
[include reference.qbk]
|
|
|
|
[include examples.qbk]
|
|
|
|
[include special_cases.qbk]
|
|
|
|
[include dependencies.qbk]
|
|
|
|
[include acknowledgments.qbk]
|
|
|
|
|
|
|
|
|