1 /* { dg-do compile } */
16 void const* address() const { return &data[0]; }
17 void * address() { return &data[0]; }
26 optional_base ( T const& val )
32 void assign ( optional<U> const& rhs )
34 if (!is_initialized())
35 if ( rhs.is_initialized() )
41 bool is_initialized() const { return m_initialized ; }
45 void construct ( T const& val )
47 new (m_storage.address()) T(val) ;
50 T const* get_ptr_impl() const
51 { return static_cast<T const*>(m_storage.address()); }
56 aligned_storage m_storage ;
61 class optional : public optional_base<T>
63 typedef optional_base<T> base ;
67 optional() : base() {}
68 optional ( T const& val ) : base(val) {}
69 optional& operator= ( optional const& rhs )
75 T const& get() const ;
77 T const* operator->() const { assert(this->is_initialized()) ; return this->get_ptr_impl() ; }
88 template<typename _Tp, std::size_t _Nm>
91 typedef _Tp value_type;
92 typedef const value_type* const_iterator;
94 value_type _M_instance[_Nm];
106 template < typename T > inline
108 make_array(const T& b1)
110 std::array<T, 1> a = { { b1 } };
116 typedef std::array<NT, 1> Base;
122 : base(make_array(x)) {}
126 using boost::optional ;
128 optional< std::pair< NT, NT > >
131 optional< V > construct_normal_offset_lines_isecC2 ( )
133 optional< std::pair<NT,NT> > ip;
135 ip = linsolve_pointC2();