optional/optional.hpp
Go to the documentation of this file.
1 // Copyright (C) 2003, 2008 Fernando Luis Cacciola Carballal.
2 // Copyright (C) 2014, 2015 Andrzej Krzemienski.
3 //
4 // Use, modification, and distribution is subject to the Boost Software
5 // License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
6 // http://www.boost.org/LICENSE_1_0.txt)
7 //
8 // See http://www.boost.org/libs/optional for documentation.
9 //
10 // You are welcome to contact the author at:
11 // fernando_cacciola@hotmail.com
12 //
13 // Revisions:
14 // 27 Apr 2008 (improved swap) Fernando Cacciola, Niels Dekker, Thorsten Ottosen
15 // 05 May 2014 (Added move semantics) Andrzej Krzemienski
16 //
17 #ifndef BOOST_OPTIONAL_OPTIONAL_FLC_19NOV2002_HPP
18 #define BOOST_OPTIONAL_OPTIONAL_FLC_19NOV2002_HPP
19 
20 #include <new>
21 #include <iosfwd>
22 
23 #include <boost/assert.hpp>
24 #include <boost/core/addressof.hpp>
25 #include <boost/core/enable_if.hpp>
27 #include <boost/core/swap.hpp>
29 #include <boost/static_assert.hpp>
31 #include <boost/type.hpp>
46 #include <boost/move/utility.hpp>
47 #include <boost/none.hpp>
49 
54 
55 #ifdef BOOST_OPTIONAL_CONFIG_USE_OLD_IMPLEMENTATION_OF_OPTIONAL
57 #else
58 namespace boost {
59 
60 namespace optional_detail {
61 
62 struct optional_tag {} ;
63 
64 
65 template<class T>
66 class optional_base : public optional_tag
67 {
68  private :
69 
72 
73  protected :
74 
75  typedef T value_type ;
76 
77  protected:
78  typedef T & reference_type ;
79  typedef T const& reference_const_type ;
80 #ifndef BOOST_OPTIONAL_DETAIL_NO_RVALUE_REFERENCES
81  typedef T && rval_reference_type ;
83 #endif
84  typedef T * pointer_type ;
85  typedef T const* pointer_const_type ;
86  typedef T const& argument_type ;
87 
88  // Creates an optional<T> uninitialized.
89  // No-throw
91  :
92  m_initialized(false) {}
93 
94  // Creates an optional<T> uninitialized.
95  // No-throw
97  :
98  m_initialized(false) {}
99 
100  // Creates an optional<T> initialized with 'val'.
101  // Can throw if T::T(T const&) does
103  :
104  m_initialized(false)
105  {
106  construct(val);
107  }
108 
109 #ifndef BOOST_OPTIONAL_DETAIL_NO_RVALUE_REFERENCES
110  // move-construct an optional<T> initialized from an rvalue-ref to 'val'.
111  // Can throw if T::T(T&&) does
113  :
114  m_initialized(false)
115  {
116  construct( boost::move(val) );
117  }
118 #endif
119 
120  // Creates an optional<T> initialized with 'val' IFF cond is true, otherwise creates an uninitialzed optional<T>.
121  // Can throw if T::T(T const&) does
122  optional_base ( bool cond, argument_type val )
123  :
124  m_initialized(false)
125  {
126  if ( cond )
127  construct(val);
128  }
129 
130  // Creates a deep copy of another optional<T>
131  // Can throw if T::T(T const&) does
133  :
134  m_initialized(false)
135  {
136  if ( rhs.is_initialized() )
137  construct(rhs.get_impl());
138  }
139 
140 #ifndef BOOST_OPTIONAL_DETAIL_NO_RVALUE_REFERENCES
141  // Creates a deep move of another optional<T>
142  // Can throw if T::T(T&&) does
144  :
145  m_initialized(false)
146  {
147  if ( rhs.is_initialized() )
148  construct( boost::move(rhs.get_impl()) );
149  }
150 #endif
151 
152 #ifndef BOOST_OPTIONAL_DETAIL_NO_RVALUE_REFERENCES
153 
154  template<class Expr, class PtrExpr>
155  explicit optional_base ( Expr&& expr, PtrExpr const* tag )
156  :
157  m_initialized(false)
158  {
159  construct(boost::forward<Expr>(expr),tag);
160  }
161 
162 #else
163  // This is used for both converting and in-place constructions.
164  // Derived classes use the 'tag' to select the appropriate
165  // implementation (the correct 'construct()' overload)
166  template<class Expr>
167  explicit optional_base ( Expr const& expr, Expr const* tag )
168  :
169  m_initialized(false)
170  {
171  construct(expr,tag);
172  }
173 
174 #endif
175 
176 
177  // No-throw (assuming T::~T() doesn't)
179 
180  // Assigns from another optional<T> (deep-copies the rhs value)
181  void assign ( optional_base const& rhs )
182  {
183  if (is_initialized())
184  {
185  if ( rhs.is_initialized() )
186  assign_value(rhs.get_impl());
187  else destroy();
188  }
189  else
190  {
191  if ( rhs.is_initialized() )
192  construct(rhs.get_impl());
193  }
194  }
195 
196 #ifndef BOOST_OPTIONAL_DETAIL_NO_RVALUE_REFERENCES
197  // Assigns from another optional<T> (deep-moves the rhs value)
198  void assign ( optional_base&& rhs )
199  {
200  if (is_initialized())
201  {
202  if ( rhs.is_initialized() )
203  assign_value( boost::move(rhs.get_impl()) );
204  else destroy();
205  }
206  else
207  {
208  if ( rhs.is_initialized() )
209  construct(boost::move(rhs.get_impl()));
210  }
211  }
212 #endif
213 
214  // Assigns from another _convertible_ optional<U> (deep-copies the rhs value)
215  template<class U>
216  void assign ( optional<U> const& rhs )
217  {
218  if (is_initialized())
219  {
220  if ( rhs.is_initialized() )
221 #ifndef BOOST_OPTIONAL_CONFIG_RESTORE_ASSIGNMENT_OF_NONCONVERTIBLE_TYPES
222  assign_value( rhs.get() );
223 #else
224  assign_value( static_cast<value_type>(rhs.get()) );
225 #endif
226 
227  else destroy();
228  }
229  else
230  {
231  if ( rhs.is_initialized() )
232 #ifndef BOOST_OPTIONAL_CONFIG_RESTORE_ASSIGNMENT_OF_NONCONVERTIBLE_TYPES
233  construct(rhs.get());
234 #else
235  construct(static_cast<value_type>(rhs.get()));
236 #endif
237  }
238  }
239 
240 #ifndef BOOST_OPTIONAL_DETAIL_NO_RVALUE_REFERENCES
241  // move-assigns from another _convertible_ optional<U> (deep-moves from the rhs value)
242  template<class U>
243  void assign ( optional<U>&& rhs )
244  {
246  if (is_initialized())
247  {
248  if ( rhs.is_initialized() )
249  assign_value( static_cast<ref_type>(rhs.get()) );
250  else destroy();
251  }
252  else
253  {
254  if ( rhs.is_initialized() )
255  construct(static_cast<ref_type>(rhs.get()));
256  }
257  }
258 #endif
259 
260  // Assigns from a T (deep-copies the rhs value)
261  void assign ( argument_type val )
262  {
263  if (is_initialized())
264  assign_value(val);
265  else construct(val);
266  }
267 
268 #ifndef BOOST_OPTIONAL_DETAIL_NO_RVALUE_REFERENCES
269  // Assigns from a T (deep-moves the rhs value)
271  {
272  if (is_initialized())
273  assign_value( boost::move(val) );
274  else construct( boost::move(val) );
275  }
276 #endif
277 
278  // Assigns from "none", destroying the current value, if any, leaving this UNINITIALIZED
279  // No-throw (assuming T::~T() doesn't)
281 
282 #ifndef BOOST_OPTIONAL_NO_INPLACE_FACTORY_SUPPORT
283 
284 #ifndef BOOST_OPTIONAL_DETAIL_NO_RVALUE_REFERENCES
285  template<class Expr, class ExprPtr>
286  void assign_expr ( Expr&& expr, ExprPtr const* tag )
287  {
288  if (is_initialized())
289  assign_expr_to_initialized(boost::forward<Expr>(expr),tag);
290  else construct(boost::forward<Expr>(expr),tag);
291  }
292 #else
293  template<class Expr>
294  void assign_expr ( Expr const& expr, Expr const* tag )
295  {
296  if (is_initialized())
298  else construct(expr,tag);
299  }
300 #endif
301 
302 #endif
303 
304  public :
305 
306  // **DEPPRECATED** Destroys the current value, if any, leaving this UNINITIALIZED
307  // No-throw (assuming T::~T() doesn't)
309 
310  // **DEPPRECATED** Replaces the current value -if any- with 'val'
311  void reset ( argument_type val ) { assign(val); }
312 
313  // Returns a pointer to the value if this is initialized, otherwise,
314  // returns NULL.
315  // No-throw
318 
319  bool is_initialized() const { return m_initialized ; }
320 
321  protected :
322 
324  {
325  ::new (m_storage.address()) value_type(val) ;
326  m_initialized = true ;
327  }
328 
329 #ifndef BOOST_OPTIONAL_DETAIL_NO_RVALUE_REFERENCES
331  {
332  ::new (m_storage.address()) value_type( boost::move(val) ) ;
333  m_initialized = true ;
334  }
335 #endif
336 
337 
338 #if (!defined BOOST_OPTIONAL_DETAIL_NO_RVALUE_REFERENCES) && (!defined BOOST_NO_CXX11_VARIADIC_TEMPLATES)
339  // Constructs in-place
340  // upon exception *this is always uninitialized
341  template<class... Args>
342  void emplace_assign ( Args&&... args )
343  {
344  destroy();
345  ::new (m_storage.address()) value_type( boost::forward<Args>(args)... );
346  m_initialized = true ;
347  }
348 #elif (!defined BOOST_OPTIONAL_DETAIL_NO_RVALUE_REFERENCES)
349  template<class Arg>
350  void emplace_assign ( Arg&& arg )
351  {
352  destroy();
353  ::new (m_storage.address()) value_type( boost::forward<Arg>(arg) );
354  m_initialized = true ;
355  }
356 
357  void emplace_assign ()
358  {
359  destroy();
360  ::new (m_storage.address()) value_type();
361  m_initialized = true ;
362  }
363 #else
364  template<class Arg>
365  void emplace_assign ( const Arg& arg )
366  {
367  destroy();
368  ::new (m_storage.address()) value_type( arg );
369  m_initialized = true ;
370  }
371 
372  template<class Arg>
373  void emplace_assign ( Arg& arg )
374  {
375  destroy();
376  ::new (m_storage.address()) value_type( arg );
377  m_initialized = true ;
378  }
379 
380  void emplace_assign ()
381  {
382  destroy();
383  ::new (m_storage.address()) value_type();
384  m_initialized = true ;
385  }
386 #endif
387 
388 #ifndef BOOST_OPTIONAL_NO_INPLACE_FACTORY_SUPPORT
389 
390 #ifndef BOOST_OPTIONAL_DETAIL_NO_RVALUE_REFERENCES
391  // Constructs in-place using the given factory
392  template<class Expr>
393  void construct ( Expr&& factory, in_place_factory_base const* )
394  {
395  boost_optional_detail::construct<value_type>(factory, m_storage.address());
396  m_initialized = true ;
397  }
398 
399  // Constructs in-place using the given typed factory
400  template<class Expr>
401  void construct ( Expr&& factory, typed_in_place_factory_base const* )
402  {
403  factory.apply(m_storage.address()) ;
404  m_initialized = true ;
405  }
406 
407  template<class Expr>
408  void assign_expr_to_initialized ( Expr&& factory, in_place_factory_base const* tag )
409  {
410  destroy();
411  construct(factory,tag);
412  }
413 
414  // Constructs in-place using the given typed factory
415  template<class Expr>
416  void assign_expr_to_initialized ( Expr&& factory, typed_in_place_factory_base const* tag )
417  {
418  destroy();
419  construct(factory,tag);
420  }
421 
422 #else
423  // Constructs in-place using the given factory
424  template<class Expr>
425  void construct ( Expr const& factory, in_place_factory_base const* )
426  {
427  boost_optional_detail::construct<value_type>(factory, m_storage.address());
428  m_initialized = true ;
429  }
430 
431  // Constructs in-place using the given typed factory
432  template<class Expr>
433  void construct ( Expr const& factory, typed_in_place_factory_base const* )
434  {
435  factory.apply(m_storage.address()) ;
436  m_initialized = true ;
437  }
438 
439  template<class Expr>
440  void assign_expr_to_initialized ( Expr const& factory, in_place_factory_base const* tag )
441  {
442  destroy();
443  construct(factory,tag);
444  }
445 
446  // Constructs in-place using the given typed factory
447  template<class Expr>
448  void assign_expr_to_initialized ( Expr const& factory, typed_in_place_factory_base const* tag )
449  {
450  destroy();
451  construct(factory,tag);
452  }
453 #endif
454 
455 #endif
456 
457 #ifndef BOOST_OPTIONAL_DETAIL_NO_RVALUE_REFERENCES
458  // Constructs using any expression implicitly convertible to the single argument
459  // of a one-argument T constructor.
460  // Converting constructions of optional<T> from optional<U> uses this function with
461  // 'Expr' being of type 'U' and relying on a converting constructor of T from U.
462  template<class Expr>
463  void construct ( Expr&& expr, void const* )
464  {
465  new (m_storage.address()) value_type(boost::forward<Expr>(expr)) ;
466  m_initialized = true ;
467  }
468 
469  // Assigns using a form any expression implicitly convertible to the single argument
470  // of a T's assignment operator.
471  // Converting assignments of optional<T> from optional<U> uses this function with
472  // 'Expr' being of type 'U' and relying on a converting assignment of T from U.
473  template<class Expr>
474  void assign_expr_to_initialized ( Expr&& expr, void const* )
475  {
476  assign_value( boost::forward<Expr>(expr) );
477  }
478 #else
479  // Constructs using any expression implicitly convertible to the single argument
480  // of a one-argument T constructor.
481  // Converting constructions of optional<T> from optional<U> uses this function with
482  // 'Expr' being of type 'U' and relying on a converting constructor of T from U.
483  template<class Expr>
484  void construct ( Expr const& expr, void const* )
485  {
486  new (m_storage.address()) value_type(expr) ;
487  m_initialized = true ;
488  }
489 
490  // Assigns using a form any expression implicitly convertible to the single argument
491  // of a T's assignment operator.
492  // Converting assignments of optional<T> from optional<U> uses this function with
493  // 'Expr' being of type 'U' and relying on a converting assignment of T from U.
494  template<class Expr>
495  void assign_expr_to_initialized ( Expr const& expr, void const* )
496  {
497  assign_value(expr);
498  }
499 
500 #endif
501 
502 #ifdef BOOST_OPTIONAL_WEAK_OVERLOAD_RESOLUTION
503  // BCB5.64 (and probably lower versions) workaround.
504  // The in-place factories are supported by means of catch-all constructors
505  // and assignment operators (the functions are parameterized in terms of
506  // an arbitrary 'Expr' type)
507  // This compiler incorrectly resolves the overload set and sinks optional<T> and optional<U>
508  // to the 'Expr'-taking functions even though explicit overloads are present for them.
509  // Thus, the following overload is needed to properly handle the case when the 'lhs'
510  // is another optional.
511  //
512  // For VC<=70 compilers this workaround dosen't work becasue the comnpiler issues and error
513  // instead of choosing the wrong overload
514  //
515 #ifndef BOOST_OPTIONAL_DETAIL_NO_RVALUE_REFERENCES
516  // Notice that 'Expr' will be optional<T> or optional<U> (but not optional_base<..>)
517  template<class Expr>
518  void construct ( Expr&& expr, optional_tag const* )
519  {
520  if ( expr.is_initialized() )
521  {
522  // An exception can be thrown here.
523  // It it happens, THIS will be left uninitialized.
524  new (m_storage.address()) value_type(boost::move(expr.get())) ;
525  m_initialized = true ;
526  }
527  }
528 #else
529  // Notice that 'Expr' will be optional<T> or optional<U> (but not optional_base<..>)
530  template<class Expr>
531  void construct ( Expr const& expr, optional_tag const* )
532  {
533  if ( expr.is_initialized() )
534  {
535  // An exception can be thrown here.
536  // It it happens, THIS will be left uninitialized.
537  new (m_storage.address()) value_type(expr.get()) ;
538  m_initialized = true ;
539  }
540  }
541 #endif
542 #endif // defined BOOST_OPTIONAL_WEAK_OVERLOAD_RESOLUTION
543 
544  void assign_value ( argument_type val ) { get_impl() = val; }
545 #ifndef BOOST_OPTIONAL_DETAIL_NO_RVALUE_REFERENCES
546  void assign_value ( rval_reference_type val ) { get_impl() = static_cast<rval_reference_type>(val); }
547 #endif
548 
549  void destroy()
550  {
551  if ( m_initialized )
552  destroy_impl() ;
553  }
554 
557 
560 
561  private :
562 
563 #if BOOST_WORKAROUND(BOOST_MSVC, <= 1600)
564  void destroy_impl ( ) { m_storage.ptr_ref()->~T() ; m_initialized = false ; }
565 #else
566  void destroy_impl ( ) { m_storage.ref().T::~T() ; m_initialized = false ; }
567 #endif
568 
569  bool m_initialized ;
571 } ;
572 
573 // definition of metafunciton is_optional_val_init_candidate
574 template <typename U>
576  : boost::conditional< boost::is_base_of<optional_detail::optional_tag, BOOST_DEDUCED_TYPENAME boost::decay<U>::type>::value
577  || boost::is_same<BOOST_DEDUCED_TYPENAME boost::decay<U>::type, none_t>::value,
578  boost::true_type, boost::false_type>::type
579 {};
580 
581 #if !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES) && !defined(BOOST_NO_CXX11_DECLTYPE) && !BOOST_WORKAROUND(BOOST_MSVC, < 1800) && !BOOST_WORKAROUND(BOOST_GCC_VERSION, < 40500) && !defined(__SUNPRO_CC)
582  // this condition is a copy paste from is_constructible.hpp
583  // I also disable SUNPRO, as it seems not to support type_traits correctly
584 
585 template <typename T, typename U>
587  : boost::conditional< boost::is_base_of<boost::in_place_factory_base, BOOST_DEDUCED_TYPENAME boost::decay<U>::type>::value
588  || boost::is_base_of<boost::typed_in_place_factory_base, BOOST_DEDUCED_TYPENAME boost::decay<U>::type>::value
589  || boost::is_constructible<T, U&&>::value
590  , boost::true_type, boost::false_type>::type
591 {};
592 
593 #else
594 
595 #define BOOST_OPTIONAL_DETAIL_NO_IS_CONSTRUCTIBLE_TRAIT
596 
597 template <typename, typename>
599 {};
600 
601 #endif // is_convertible condition
602 
603 template <typename T, typename U>
605  : boost::conditional< !is_optional_related<U>::value && is_convertible_to_T_or_factory<T, U>::value
606  , boost::true_type, boost::false_type>::type
607 {};
608 
609 } // namespace optional_detail
610 
611 template<class T>
613 {
615 
616  public :
617 
619 
623 #ifndef BOOST_OPTIONAL_DETAIL_NO_RVALUE_REFERENCES
626 #endif
630 
631  // Creates an optional<T> uninitialized.
632  // No-throw
634 
635  // Creates an optional<T> uninitialized.
636  // No-throw
637  optional( none_t none_ ) BOOST_NOEXCEPT : base(none_) {}
638 
639  // Creates an optional<T> initialized with 'val'.
640  // Can throw if T::T(T const&) does
641  optional ( argument_type val ) : base(val) {}
642 
643 #ifndef BOOST_OPTIONAL_DETAIL_NO_RVALUE_REFERENCES
644  // Creates an optional<T> initialized with 'move(val)'.
645  // Can throw if T::T(T &&) does
647  {}
648 #endif
649 
650  // Creates an optional<T> initialized with 'val' IFF cond is true, otherwise creates an uninitialized optional.
651  // Can throw if T::T(T const&) does
652  optional ( bool cond, argument_type val ) : base(cond,val) {}
653 
654  // NOTE: MSVC needs templated versions first
655 
656  // Creates a deep copy of another convertible optional<U>
657  // Requires a valid conversion from U to T.
658  // Can throw if T::T(U const&) does
659  template<class U>
660  explicit optional ( optional<U> const& rhs )
661  :
662  base()
663  {
664  if ( rhs.is_initialized() )
665  this->construct(rhs.get());
666  }
667 
668 #ifndef BOOST_OPTIONAL_DETAIL_NO_RVALUE_REFERENCES
669  // Creates a deep move of another convertible optional<U>
670  // Requires a valid conversion from U to T.
671  // Can throw if T::T(U&&) does
672  template<class U>
673  explicit optional ( optional<U> && rhs )
674  :
675  base()
676  {
677  if ( rhs.is_initialized() )
678  this->construct( boost::move(rhs.get()) );
679  }
680 #endif
681 
682 #ifndef BOOST_OPTIONAL_NO_INPLACE_FACTORY_SUPPORT
683  // Creates an optional<T> with an expression which can be either
684  // (a) An instance of InPlaceFactory (i.e. in_place(a,b,...,n);
685  // (b) An instance of TypedInPlaceFactory ( i.e. in_place<T>(a,b,...,n);
686  // (c) Any expression implicitly convertible to the single type
687  // of a one-argument T's constructor.
688  // (d*) Weak compilers (BCB) might also resolved Expr as optional<T> and optional<U>
689  // even though explicit overloads are present for these.
690  // Depending on the above some T ctor is called.
691  // Can throw if the resolved T ctor throws.
692 #ifndef BOOST_OPTIONAL_DETAIL_NO_RVALUE_REFERENCES
693 
694 
695  template<class Expr>
696  explicit optional ( Expr&& expr,
698  )
699  : base(boost::forward<Expr>(expr),boost::addressof(expr))
700  {}
701 
702 #else
703  template<class Expr>
704  explicit optional ( Expr const& expr ) : base(expr,boost::addressof(expr)) {}
705 #endif // !defined BOOST_OPTIONAL_DETAIL_NO_RVALUE_REFERENCES
706 #endif // !defined BOOST_OPTIONAL_NO_INPLACE_FACTORY_SUPPORT
707 
708  // Creates a deep copy of another optional<T>
709  // Can throw if T::T(T const&) does
710  optional ( optional const& rhs ) : base( static_cast<base const&>(rhs) ) {}
711 
712 #ifndef BOOST_OPTIONAL_DETAIL_NO_RVALUE_REFERENCES
713  // Creates a deep move of another optional<T>
714  // Can throw if T::T(T&&) does
715  optional ( optional && rhs )
717  : base( boost::move(rhs) )
718  {}
719 
720 #endif
721 
722 #if BOOST_WORKAROUND(_MSC_VER, <= 1600)
723  // On old MSVC compilers the implicitly declared dtor is not called
724  ~optional() {}
725 #endif
726 
727 
728 #if !defined(BOOST_OPTIONAL_NO_INPLACE_FACTORY_SUPPORT) && !defined(BOOST_OPTIONAL_WEAK_OVERLOAD_RESOLUTION)
729  // Assigns from an expression. See corresponding constructor.
730  // Basic Guarantee: If the resolved T ctor throws, this is left UNINITIALIZED
731 #ifndef BOOST_OPTIONAL_DETAIL_NO_RVALUE_REFERENCES
732 
733  template<class Expr>
735  operator= ( Expr&& expr )
736  {
737  this->assign_expr(boost::forward<Expr>(expr),boost::addressof(expr));
738  return *this ;
739  }
740 
741 #else
742  template<class Expr>
743  optional& operator= ( Expr const& expr )
744  {
745  this->assign_expr(expr,boost::addressof(expr));
746  return *this ;
747  }
748 #endif // !defined BOOST_OPTIONAL_DETAIL_NO_RVALUE_REFERENCES
749 #endif // !defined(BOOST_OPTIONAL_NO_INPLACE_FACTORY_SUPPORT) && !defined(BOOST_OPTIONAL_WEAK_OVERLOAD_RESOLUTION)
750 
751  // Copy-assigns from another convertible optional<U> (converts && deep-copies the rhs value)
752  // Requires a valid conversion from U to T.
753  // Basic Guarantee: If T::T( U const& ) throws, this is left UNINITIALIZED
754  template<class U>
755  optional& operator= ( optional<U> const& rhs )
756  {
757  this->assign(rhs);
758  return *this ;
759  }
760 
761 #ifndef BOOST_OPTIONAL_DETAIL_NO_RVALUE_REFERENCES
762  // Move-assigns from another convertible optional<U> (converts && deep-moves the rhs value)
763  // Requires a valid conversion from U to T.
764  // Basic Guarantee: If T::T( U && ) throws, this is left UNINITIALIZED
765  template<class U>
766  optional& operator= ( optional<U> && rhs )
767  {
768  this->assign(boost::move(rhs));
769  return *this ;
770  }
771 #endif
772 
773  // Assigns from another optional<T> (deep-copies the rhs value)
774  // Basic Guarantee: If T::T( T const& ) throws, this is left UNINITIALIZED
775  // (NOTE: On BCB, this operator is not actually called and left is left UNMODIFIED in case of a throw)
776  optional& operator= ( optional const& rhs )
777  {
778  this->assign( static_cast<base const&>(rhs) ) ;
779  return *this ;
780  }
781 
782 #ifndef BOOST_OPTIONAL_DETAIL_NO_RVALUE_REFERENCES
783  // Assigns from another optional<T> (deep-moves the rhs value)
784  optional& operator= ( optional && rhs )
786  {
787  this->assign( static_cast<base &&>(rhs) ) ;
788  return *this ;
789  }
790 #endif
791 
792  // Assigns from a T (deep-copies the rhs value)
793  // Basic Guarantee: If T::( T const& ) throws, this is left UNINITIALIZED
794  optional& operator= ( argument_type val )
795  {
796  this->assign( val ) ;
797  return *this ;
798  }
799 
800 #ifndef BOOST_OPTIONAL_DETAIL_NO_RVALUE_REFERENCES
801  // Assigns from a T (deep-moves the rhs value)
802  optional& operator= ( rval_reference_type val )
803  {
804  this->assign( boost::move(val) ) ;
805  return *this ;
806  }
807 #endif
808 
809  // Assigns from a "none"
810  // Which destroys the current value, if any, leaving this UNINITIALIZED
811  // No-throw (assuming T::~T() doesn't)
812  optional& operator= ( none_t none_ ) BOOST_NOEXCEPT
813  {
814  this->assign( none_ ) ;
815  return *this ;
816  }
817 
818 #if (!defined BOOST_OPTIONAL_DETAIL_NO_RVALUE_REFERENCES) && (!defined BOOST_NO_CXX11_VARIADIC_TEMPLATES)
819  // Constructs in-place
820  // upon exception *this is always uninitialized
821  template<class... Args>
822  void emplace ( Args&&... args )
823  {
824  this->emplace_assign( boost::forward<Args>(args)... );
825  }
826 #elif (!defined BOOST_OPTIONAL_DETAIL_NO_RVALUE_REFERENCES)
827  template<class Arg>
828  void emplace ( Arg&& arg )
829  {
830  this->emplace_assign( boost::forward<Arg>(arg) );
831  }
832 
833  void emplace ()
834  {
835  this->emplace_assign();
836  }
837 #else
838  template<class Arg>
839  void emplace ( const Arg& arg )
840  {
841  this->emplace_assign( arg );
842  }
843 
844  template<class Arg>
845  void emplace ( Arg& arg )
846  {
847  this->emplace_assign( arg );
848  }
849 
850  void emplace ()
851  {
852  this->emplace_assign();
853  }
854 #endif
855 
856  void swap( optional & arg )
858  {
859  // allow for Koenig lookup
860  boost::swap(*this, arg);
861  }
862 
863 
864  // Returns a reference to the value if this is initialized, otherwise,
865  // the behaviour is UNDEFINED
866  // No-throw
867  reference_const_type get() const { BOOST_ASSERT(this->is_initialized()) ; return this->get_impl(); }
868  reference_type get() { BOOST_ASSERT(this->is_initialized()) ; return this->get_impl(); }
869 
870  // Returns a copy of the value if this is initialized, 'v' otherwise
871  reference_const_type get_value_or ( reference_const_type v ) const { return this->is_initialized() ? get() : v ; }
872  reference_type get_value_or ( reference_type v ) { return this->is_initialized() ? get() : v ; }
873 
874  // Returns a pointer to the value if this is initialized, otherwise,
875  // the behaviour is UNDEFINED
876  // No-throw
877  pointer_const_type operator->() const { BOOST_ASSERT(this->is_initialized()) ; return this->get_ptr_impl() ; }
878  pointer_type operator->() { BOOST_ASSERT(this->is_initialized()) ; return this->get_ptr_impl() ; }
879 
880  // Returns a reference to the value if this is initialized, otherwise,
881  // the behaviour is UNDEFINED
882  // No-throw
883 #if (!defined BOOST_NO_CXX11_REF_QUALIFIERS) && (!defined BOOST_OPTIONAL_DETAIL_NO_RVALUE_REFERENCES)
884  reference_const_type operator *() const& { return this->get() ; }
885  reference_type operator *() & { return this->get() ; }
886  reference_type_of_temporary_wrapper operator *() && { return boost::move(this->get()) ; }
887 #else
888  reference_const_type operator *() const { return this->get() ; }
889  reference_type operator *() { return this->get() ; }
890 #endif // !defined BOOST_NO_CXX11_REF_QUALIFIERS
891 
892 #if (!defined BOOST_NO_CXX11_REF_QUALIFIERS) && (!defined BOOST_OPTIONAL_DETAIL_NO_RVALUE_REFERENCES)
893  reference_const_type value() const&
894  {
895  if (this->is_initialized())
896  return this->get() ;
897  else
899  }
900 
902  {
903  if (this->is_initialized())
904  return this->get() ;
905  else
907  }
908 
910  {
911  if (this->is_initialized())
912  return boost::move(this->get()) ;
913  else
915  }
916 
917 #else
918  reference_const_type value() const
919  {
920  if (this->is_initialized())
921  return this->get() ;
922  else
924  }
925 
926  reference_type value()
927  {
928  if (this->is_initialized())
929  return this->get() ;
930  else
931  throw_exception(bad_optional_access());
932  }
933 #endif
934 
935 
936 #ifndef BOOST_NO_CXX11_REF_QUALIFIERS
937  template <class U>
938  value_type value_or ( U&& v ) const&
939  {
940  if (this->is_initialized())
941  return get();
942  else
943  return boost::forward<U>(v);
944  }
945 
946  template <class U>
947  value_type value_or ( U&& v ) &&
948  {
949  if (this->is_initialized())
950  return boost::move(get());
951  else
952  return boost::forward<U>(v);
953  }
954 #elif !defined BOOST_OPTIONAL_DETAIL_NO_RVALUE_REFERENCES
955  template <class U>
956  value_type value_or ( U&& v ) const
957  {
958  if (this->is_initialized())
959  return get();
960  else
961  return boost::forward<U>(v);
962  }
963 #else
964  template <class U>
965  value_type value_or ( U const& v ) const
966  {
967  if (this->is_initialized())
968  return get();
969  else
970  return v;
971  }
972 
973  template <class U>
974  value_type value_or ( U& v ) const
975  {
976  if (this->is_initialized())
977  return get();
978  else
979  return v;
980  }
981 #endif
982 
983 
984 #ifndef BOOST_NO_CXX11_REF_QUALIFIERS
985  template <typename F>
986  value_type value_or_eval ( F f ) const&
987  {
988  if (this->is_initialized())
989  return get();
990  else
991  return f();
992  }
993 
994  template <typename F>
996  {
997  if (this->is_initialized())
998  return boost::move(get());
999  else
1000  return f();
1001  }
1002 #else
1003  template <typename F>
1004  value_type value_or_eval ( F f ) const
1005  {
1006  if (this->is_initialized())
1007  return get();
1008  else
1009  return f();
1010  }
1011 #endif
1012 
1013  bool operator!() const BOOST_NOEXCEPT { return !this->is_initialized() ; }
1014 
1016 } ;
1017 
1018 } // namespace boost
1019 
1020 #endif // BOOST_OPTIONAL_CONFIG_USE_OLD_IMPLEMENTATION_OF_OPTIONAL
1021 
1022 namespace boost {
1023 
1024 #ifndef BOOST_OPTIONAL_DETAIL_NO_RVALUE_REFERENCES
1025 template<class T>
1026 class optional<T&&>
1027 {
1028  BOOST_STATIC_ASSERT_MSG(sizeof(T) == 0, "Optional rvalue references are illegal.");
1029 } ;
1030 #endif
1031 
1032 } // namespace boost
1033 
1034 #ifndef BOOST_OPTIONAL_CONFIG_DONT_SPECIALIZE_OPTIONAL_REFS
1036 #endif
1037 
1038 namespace boost {
1039 
1040 // Returns optional<T>(v)
1041 template<class T>
1042 inline
1044 {
1045  return optional<T>(v);
1046 }
1047 
1048 // Returns optional<T>(cond,v)
1049 template<class T>
1050 inline
1051 optional<T> make_optional ( bool cond, T const& v )
1052 {
1053  return optional<T>(cond,v);
1054 }
1055 
1056 // Returns a reference to the value if this is initialized, otherwise, the behaviour is UNDEFINED.
1057 // No-throw
1058 template<class T>
1059 inline
1061 get ( optional<T> const& opt )
1062 {
1063  return opt.get() ;
1064 }
1065 
1066 template<class T>
1067 inline
1070 {
1071  return opt.get() ;
1072 }
1073 
1074 // Returns a pointer to the value if this is initialized, otherwise, returns NULL.
1075 // No-throw
1076 template<class T>
1077 inline
1079 get ( optional<T> const* opt )
1080 {
1081  return opt->get_ptr() ;
1082 }
1083 
1084 template<class T>
1085 inline
1088 {
1089  return opt->get_ptr() ;
1090 }
1091 
1092 // Returns a reference to the value if this is initialized, otherwise, the behaviour is UNDEFINED.
1093 // No-throw
1094 template<class T>
1095 inline
1098 {
1099  return opt.get_value_or(v) ;
1100 }
1101 
1102 template<class T>
1103 inline
1106 {
1107  return opt.get_value_or(v) ;
1108 }
1109 
1110 // Returns a pointer to the value if this is initialized, otherwise, returns NULL.
1111 // No-throw
1112 template<class T>
1113 inline
1115 get_pointer ( optional<T> const& opt )
1116 {
1117  return opt.get_ptr() ;
1118 }
1119 
1120 template<class T>
1121 inline
1124 {
1125  return opt.get_ptr() ;
1126 }
1127 
1128 } // namespace boost
1129 
1130 namespace boost {
1131 
1132 // The following declaration prevents a bug where operator safe-bool is used upon streaming optional object if you forget the IO header.
1133 template<class CharType, class CharTrait>
1134 std::basic_ostream<CharType, CharTrait>&
1135 operator<<(std::basic_ostream<CharType, CharTrait>& os, optional_detail::optional_tag const&)
1136 {
1137  BOOST_STATIC_ASSERT_MSG(sizeof(CharType) == 0, "If you want to output boost::optional, include header <boost/optional/optional_io.hpp>");
1138  return os;
1139 }
1140 
1141 } // namespace boost
1142 
1145 
1146 #endif // header guard
boost::operator<<
std::basic_ostream< CharType, CharTrait > & operator<<(std::basic_ostream< CharType, CharTrait > &os, optional_detail::optional_tag const &)
Definition: optional/optional.hpp:1135
boost::optional_detail::optional_base::optional_base
optional_base(argument_type val)
Definition: optional/optional.hpp:102
boost::optional_detail::aligned_storage::ref
T const & ref() const
Definition: optional_aligned_storage.hpp:67
boost::swap
void swap(any &lhs, any &rhs) BOOST_NOEXCEPT
Definition: any.hpp:223
boost::optional_detail::optional_base::construct
void construct(argument_type val)
Definition: old_optional_implementation.hpp:353
boost::optional_detail::is_convertible_to_T_or_factory
Definition: optional/optional.hpp:586
boost::optional_detail::optional_base::assign
void assign(optional< U > &&rhs)
Definition: optional/optional.hpp:243
boost::optional_detail::optional_base::pointer_const_type
BOOST_DEDUCED_TYPENAME types::pointer_const_type pointer_const_type
Definition: old_optional_implementation.hpp:115
boost::optional::operator->
pointer_type operator->()
Definition: optional/optional.hpp:878
boost::optional_detail::optional_base::assign_expr_to_initialized
void assign_expr_to_initialized(Expr &&factory, in_place_factory_base const *tag)
Definition: old_optional_implementation.hpp:440
remove_reference.hpp
boost::optional::get_value_or
reference_type get_value_or(reference_type v)
Definition: optional/optional.hpp:872
BOOST_STATIC_ASSERT_MSG
#define BOOST_STATIC_ASSERT_MSG(...)
Definition: static_assert.hpp:31
T
T
Definition: mem_fn_cc.hpp:25
boost::get_optional_value_or
BOOST_DEDUCED_TYPENAME optional< T >::reference_const_type get_optional_value_or(optional< T > const &opt, BOOST_DEDUCED_TYPENAME optional< T >::reference_const_type v)
Definition: optional/optional.hpp:1097
BOOST_EXPLICIT_OPERATOR_BOOL_NOEXCEPT
#define BOOST_EXPLICIT_OPERATOR_BOOL_NOEXCEPT()
The macro defines a noexcept explicit operator of conversion to bool.
Definition: explicit_operator_bool.hpp:49
boost::optional::value_or
value_type value_or(U &&v) const &
Definition: optional/optional.hpp:938
conditional.hpp
optional_config.hpp
is_rvalue_reference.hpp
boost::optional::value_type
BOOST_DEDUCED_TYPENAME base::value_type value_type
Definition: optional/optional.hpp:620
boost::optional_detail::optional_base::~optional_base
~optional_base()
Definition: optional/optional.hpp:178
boost::optional::swap
void swap(optional &arg) BOOST_NOEXCEPT_IF(
Definition: optional/optional.hpp:856
boost::optional_detail::optional_base::assign_value
void assign_value(argument_type val)
Definition: optional/optional.hpp:544
boost::optional::value_or
value_type value_or(U &&v) &&
Definition: optional/optional.hpp:947
boost::optional_detail::optional_base::construct
void construct(Expr &&factory, in_place_factory_base const *)
Definition: optional/optional.hpp:393
static_assert.hpp
boost::optional::operator->
pointer_const_type operator->() const
Definition: optional/optional.hpp:877
boost::type
Definition: type.hpp:14
boost::throw_exception
BOOST_NORETURN void throw_exception(E const &e)
Definition: throw_exception.hpp:62
explicit_operator_bool.hpp
compare_pointees.hpp
alignment_of.hpp
boost::optional_detail::optional_base::get_impl
reference_const_type get_impl() const
Definition: old_optional_implementation.hpp:591
boost::optional_detail::optional_base::argument_type
BOOST_DEDUCED_TYPENAME types::argument_type argument_type
Definition: old_optional_implementation.hpp:116
boost::optional_detail::optional_base::reference_const_type
BOOST_DEDUCED_TYPENAME types::reference_const_type reference_const_type
Definition: old_optional_implementation.hpp:109
boost::optional_detail::optional_base::this_type
optional_base< T > this_type
Definition: optional/optional.hpp:71
enable_if.hpp
boost
BOOST_MOVE_USE_STANDARD_LIBRARY_MOVE.
boost::optional_detail::optional_base::construct
void construct(rval_reference_type val)
Definition: optional/optional.hpp:330
boost::optional_detail::optional_base::get_ptr
pointer_type get_ptr()
Definition: optional/optional.hpp:317
boost::optional_detail::optional_base::rval_reference_type
BOOST_DEDUCED_TYPENAME types::rval_reference_type rval_reference_type
Definition: old_optional_implementation.hpp:111
boost::addressof
BOOST_FORCEINLINE T * addressof(T &v)
Definition: core/addressof.hpp:108
boost::none_t
Definition: none_t.hpp:29
optional_swap.hpp
boost::optional::optional
optional(none_t none_) BOOST_NOEXCEPT
Definition: optional/optional.hpp:637
boost::optional_detail::optional_base::assign
void assign(optional_base &&rhs)
Definition: optional/optional.hpp:198
boost::optional_detail::optional_base::get_impl
reference_type get_impl()
Definition: optional/optional.hpp:556
boost::optional_detail::optional_base::assign_expr_to_initialized
void assign_expr_to_initialized(Expr &&expr, void const *)
Definition: optional/optional.hpp:474
boost::optional_detail::is_optional_val_init_candidate
Definition: optional/optional.hpp:604
boost::optional_detail::optional_base::emplace_assign
void emplace_assign(Args &&... args)
Definition: optional/optional.hpp:342
boost::optional::optional
optional() BOOST_NOEXCEPT
Definition: optional/optional.hpp:633
boost::optional::get_value_or
reference_const_type get_value_or(reference_const_type v) const
Definition: optional/optional.hpp:871
boost::optional_detail::optional_base::assign
void assign(optional_base const &rhs)
Definition: optional/optional.hpp:181
is_nothrow_move_constructible.hpp
f
f
boost::optional_detail::optional_base::storage_type
aligned_storage< T > storage_type
Definition: optional/optional.hpp:70
boost::optional::value_or_eval
value_type value_or_eval(F f) &&
Definition: optional/optional.hpp:995
boost::optional_detail::optional_base::reference_type_of_temporary_wrapper
T && reference_type_of_temporary_wrapper
Definition: optional/optional.hpp:82
optional_factory_support.hpp
boost::optional_detail::optional_base::assign
void assign(argument_type val)
Definition: optional/optional.hpp:261
boost::optional_detail::optional_base::pointer_type
BOOST_DEDUCED_TYPENAME types::pointer_type pointer_type
Definition: old_optional_implementation.hpp:114
boost::forward
BOOST_MOVE_FORCEINLINE T && forward(typename ::boost::move_detail::remove_reference< T >::type &t) BOOST_NOEXCEPT
Definition: utility_core.hpp:248
boost::optional_detail::optional_base::optional_base
optional_base(optional_base &&rhs)
Definition: optional/optional.hpp:143
boost::optional::base
optional_detail::optional_base< T > base
Definition: optional/optional.hpp:614
boost::optional::get
reference_const_type get() const
Definition: old_optional_implementation.hpp:905
boost::arg
Definition: bind/arg.hpp:29
optional_aligned_storage.hpp
boost::optional_detail::optional_base::reference_type
BOOST_DEDUCED_TYPENAME types::reference_type reference_type
Definition: old_optional_implementation.hpp:108
boost::optional_detail::optional_base::pointer_type
T * pointer_type
Definition: optional/optional.hpp:84
boost::is_nothrow_move_constructible
Definition: is_nothrow_move_constructible.hpp:49
BOOST_ASSERT
#define BOOST_ASSERT(expr)
Definition: assert.hpp:60
boost::optional_detail::optional_base::construct
void construct(Expr &&factory, typed_in_place_factory_base const *)
Definition: optional/optional.hpp:401
boost::optional::optional
optional(rval_reference_type val)
Definition: optional/optional.hpp:646
boost::optional_detail::optional_base::assign_expr_to_initialized
void assign_expr_to_initialized(Expr &&factory, typed_in_place_factory_base const *tag)
Definition: optional/optional.hpp:416
BOOST_NOEXCEPT
#define BOOST_NOEXCEPT
Definition: suffix.hpp:938
boost::optional::operator!
bool operator!() const BOOST_NOEXCEPT
Definition: optional/optional.hpp:1013
boost::optional_detail::optional_tag
Definition: old_optional_implementation.hpp:75
boost::optional_detail::optional_base::optional_base
optional_base()
Definition: optional/optional.hpp:90
boost::optional_detail::optional_base::reference_type
T & reference_type
Definition: optional/optional.hpp:78
type.hpp
arg
Definition: arg_fwd.hpp:23
boost::optional::reference_type_of_temporary_wrapper
BOOST_DEDUCED_TYPENAME base::reference_type_of_temporary_wrapper reference_type_of_temporary_wrapper
Definition: optional/optional.hpp:625
boost::foreach::tag
boost_foreach_argument_dependent_lookup_hack tag
Definition: foreach_fwd.hpp:31
boost::optional_detail::optional_base::assign_expr
void assign_expr(Expr &&expr, ExprPtr const *tag)
Definition: optional/optional.hpp:286
remove_const.hpp
boost::make_optional
optional< T > make_optional(T const &v)
Definition: optional/optional.hpp:1043
is_lvalue_reference.hpp
boost::get_pointer
T * get_pointer(T *p)
Definition: get_pointer.hpp:20
optional_relops.hpp
boost::optional::reference_type
BOOST_DEDUCED_TYPENAME base::reference_type reference_type
Definition: optional/optional.hpp:621
boost::bad_optional_access
Definition: bad_optional_access.hpp:22
old_optional_implementation.hpp
is_same.hpp
boost::conditional
Definition: conditional.hpp:14
boost::optional_detail::optional_base::assign
void assign(none_t) BOOST_NOEXCEPT
Definition: optional/optional.hpp:280
assert.hpp
boost::enable_if
Definition: core/enable_if.hpp:41
boost::optional_detail::optional_base::m_initialized
bool m_initialized
Definition: old_optional_implementation.hpp:639
boost::optional_detail::optional_base::get_ptr_impl
pointer_const_type get_ptr_impl() const
Definition: old_optional_implementation.hpp:594
boost::is_nothrow_move_assignable
Definition: is_nothrow_move_assignable.hpp:53
boost::optional::optional
optional(argument_type val)
Definition: optional/optional.hpp:641
is_nothrow_move_assignable.hpp
boost::optional_detail::optional_base::is_initialized
bool is_initialized() const
Definition: old_optional_implementation.hpp:349
boost::optional_detail::optional_base::value_type
T value_type
Definition: optional/optional.hpp:75
boost::optional::value
reference_const_type value() const &
Definition: optional/optional.hpp:893
none.hpp
boost::optional_detail::optional_base::argument_type
T const & argument_type
Definition: optional/optional.hpp:86
BOOST_DEDUCED_TYPENAME
#define BOOST_DEDUCED_TYPENAME
Definition: suffix.hpp:467
boost::optional_detail::optional_base::get_ptr
pointer_const_type get_ptr() const
Definition: optional/optional.hpp:316
BOOST_NOEXCEPT_IF
#define BOOST_NOEXCEPT_IF(Predicate)
Definition: suffix.hpp:940
boost::optional_detail::optional_base::reference_type_of_temporary_wrapper
BOOST_DEDUCED_TYPENAME types::reference_type_of_temporary_wrapper reference_type_of_temporary_wrapper
Definition: old_optional_implementation.hpp:112
is_base_of.hpp
boost::optional::get
reference_type get()
Definition: optional/optional.hpp:868
type_with_alignment.hpp
bad_optional_access.hpp
boost::optional::pointer_type
BOOST_DEDUCED_TYPENAME base::pointer_type pointer_type
Definition: optional/optional.hpp:627
boost::optional_detail::optional_base::reset
void reset(argument_type val)
Definition: optional/optional.hpp:311
boost::optional_detail::optional_base::assign_value
void assign_value(argument_type val, is_not_reference_tag)
Definition: old_optional_implementation.hpp:578
boost::optional::value_or_eval
value_type value_or_eval(F f) const &
Definition: optional/optional.hpp:986
boost::optional::reference_const_type
BOOST_DEDUCED_TYPENAME base::reference_const_type reference_const_type
Definition: optional/optional.hpp:622
boost::optional::optional
optional(optional< U > &&rhs)
Definition: optional/optional.hpp:673
boost::optional::value
reference_type value() &
Definition: optional/optional.hpp:901
optional_fwd.hpp
decay.hpp
utility.hpp
boost::optional_detail::optional_base::assign
void assign(optional< U > const &rhs)
Definition: optional/optional.hpp:216
boost::optional_detail::optional_base::optional_base
optional_base(bool cond, argument_type val)
Definition: optional/optional.hpp:122
boost::optional_detail::optional_base::optional_base
optional_base(none_t)
Definition: optional/optional.hpp:96
swap.hpp
boost::optional::rval_reference_type
BOOST_DEDUCED_TYPENAME base::rval_reference_type rval_reference_type
Definition: old_optional_implementation.hpp:658
boost::optional_detail::optional_base::optional_base
optional_base(rval_reference_type val)
Definition: optional/optional.hpp:112
boost::optional_detail::aligned_storage::address
void const * address() const
Definition: optional_aligned_storage.hpp:46
boost::get
BOOST_DEDUCED_TYPENAME optional< T >::reference_const_type get(optional< T > const &opt)
Definition: optional/optional.hpp:1061
boost::optional_detail::optional_base::destroy_impl
void destroy_impl()
Definition: optional/optional.hpp:566
boost::optional_detail::optional_base::reference_const_type
T const & reference_const_type
Definition: optional/optional.hpp:79
boost::optional::pointer_const_type
BOOST_DEDUCED_TYPENAME base::pointer_const_type pointer_const_type
Definition: optional/optional.hpp:628
boost::optional_detail::optional_base::reset
void reset() BOOST_NOEXCEPT
Definition: optional/optional.hpp:308
boost::optional_detail::aligned_storage
Definition: optional_aligned_storage.hpp:25
boost::optional_detail::aligned_storage::ptr_ref
T const * ptr_ref() const
Definition: optional_aligned_storage.hpp:63
boost::optional::emplace
void emplace(Args &&... args)
Definition: optional/optional.hpp:822
boost::optional_detail::optional_base::destroy
void destroy()
Definition: old_optional_implementation.hpp:585
boost::optional_detail::optional_base::construct
void construct(Expr &&expr, void const *)
Definition: optional/optional.hpp:463
boost::optional::value
reference_type_of_temporary_wrapper value() &&
Definition: optional/optional.hpp:909
boost::optional_detail::optional_base::optional_base
optional_base(Expr &&expr, PtrExpr const *tag)
Definition: optional/optional.hpp:155
boost::optional_detail::optional_base
Definition: old_optional_implementation.hpp:78
throw_exception.hpp
boost::optional::this_type
optional< T > this_type
Definition: optional/optional.hpp:618
boost::move
BOOST_MOVE_FORCEINLINE ::boost::move_detail::remove_reference< T >::type && move(T &&t) BOOST_NOEXCEPT
Definition: utility_core.hpp:212
boost::optional_detail::optional_base::assign_value
void assign_value(rval_reference_type val)
Definition: optional/optional.hpp:546
args
boost::optional_detail::optional_base::assign
void assign(rval_reference_type val)
Definition: optional/optional.hpp:270
boost::optional::optional
optional(optional &&rhs) BOOST_NOEXCEPT_IF(
Definition: optional/optional.hpp:715
boost::optional_detail::optional_base::storage_type
aligned_storage< internal_type > storage_type
Definition: old_optional_implementation.hpp:88
boost::optional_detail::optional_base::optional_base
optional_base(optional_base const &rhs)
Definition: optional/optional.hpp:132
is_constructible.hpp
has_nothrow_constructor.hpp
boost::optional_detail::optional_base::rval_reference_type
T && rval_reference_type
Definition: optional/optional.hpp:81
boost::optional::optional
optional(Expr &&expr, BOOST_DEDUCED_TYPENAME boost::enable_if< optional_detail::is_optional_val_init_candidate< T, Expr > >::type *=0)
Definition: optional/optional.hpp:696
boost::optional_detail::optional_base::get_ptr_impl
pointer_type get_ptr_impl()
Definition: optional/optional.hpp:559
boost::optional::optional
optional(optional const &rhs)
Definition: optional/optional.hpp:710
boost::integral_constant
Definition: integral_constant.hpp:52
addressof.hpp
boost::optional::optional
optional(optional< U > const &rhs)
Definition: optional/optional.hpp:660
optional_reference_spec.hpp
boost::optional::optional
optional(bool cond, argument_type val)
Definition: optional/optional.hpp:652
boost::optional_detail::optional_base::m_storage
storage_type m_storage
Definition: old_optional_implementation.hpp:640
boost::optional
Definition: old_optional_implementation.hpp:646
boost::optional::argument_type
BOOST_DEDUCED_TYPENAME base::argument_type argument_type
Definition: optional/optional.hpp:629
boost::optional_detail::optional_base::pointer_const_type
T const * pointer_const_type
Definition: optional/optional.hpp:85


sick_visionary_ros
Author(s): SICK AG TechSupport 3D Snapshot
autogenerated on Thu Feb 8 2024 03:45:34