implementation_notes.qbk

来自「Boost provides free peer-reviewed portab」· QBK 代码 · 共 29 行

QBK
29
字号
[/    Boost.Optional    Copyright (c) 2003-2007 Fernando Luis Cacciola Carballal    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)][#optional_implementation_notes][section Implementation Notes]`optional<T>` is currently implemented using a custom aligned storage facilitybuilt from `alignment_of` and `type_with_alignment` (both from Type Traits). Ituses a separate boolean flag to indicate the initialization state.Placement new with `T`'s copy constructor and `T`'s destructor are explicitly usedto initialize,copy and destroy optional values.As a result, `T`'s default constructor is effectively by-passed, but the exceptionguarantees are basic.It is planned to replace the current implementation with another with strongerexception safety, such as a future `boost::variant`.[endsect] 

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?