| 120 | |
| 121 | template<class T> |
| 122 | class optional_base : public optional_tag |
| 123 | { |
| 124 | private : |
| 125 | |
| 126 | typedef aligned_storage<T> storage_type ; |
| 127 | typedef optional_base<T> this_type ; |
| 128 | |
| 129 | protected : |
| 130 | |
| 131 | typedef T value_type ; |
| 132 | typedef typename boost::remove_const<T>::type unqualified_value_type; |
| 133 | |
| 134 | protected: |
| 135 | typedef T & reference_type ; |
| 136 | typedef T const& reference_const_type ; |
| 137 | #ifndef BOOST_OPTIONAL_DETAIL_NO_RVALUE_REFERENCES |
| 138 | typedef T && rval_reference_type ; |
| 139 | typedef T && reference_type_of_temporary_wrapper ; |
| 140 | #endif |
| 141 | typedef T * pointer_type ; |
| 142 | typedef T const* pointer_const_type ; |
| 143 | typedef T const& argument_type ; |
| 144 | |
| 145 | // Creates an optional<T> uninitialized. |
| 146 | // No-throw |
| 147 | optional_base() |
| 148 | : |
| 149 | m_initialized(false) {} |
| 150 | |
| 151 | // Creates an optional<T> uninitialized. |
| 152 | // No-throw |
| 153 | optional_base ( none_t ) |
| 154 | : |
| 155 | m_initialized(false) {} |
| 156 | |
| 157 | // Creates an optional<T> initialized with 'val'. |
| 158 | // Can throw if T::T(T const&) does |
| 159 | optional_base ( init_value_tag, argument_type val ) |
| 160 | : |
| 161 | m_initialized(false) |
| 162 | { |
| 163 | construct(val); |
| 164 | } |
| 165 | |
| 166 | #ifndef BOOST_OPTIONAL_DETAIL_NO_RVALUE_REFERENCES |
| 167 | // move-construct an optional<T> initialized from an rvalue-ref to 'val'. |
| 168 | // Can throw if T::T(T&&) does |
| 169 | optional_base ( init_value_tag, rval_reference_type val ) |
| 170 | : |
| 171 | m_initialized(false) |
| 172 | { |
| 173 | construct( boost::move(val) ); |
| 174 | } |
| 175 | #endif |
| 176 | |
| 177 | // Creates an optional<T> initialized with 'val' IFF cond is true, otherwise creates an uninitialized optional<T>. |
| 178 | // Can throw if T::T(T const&) does |
| 179 | optional_base ( bool cond, argument_type val ) |
nothing calls this directly
no test coverage detected