Lines Matching refs:T
147 template <class T>
160 template <class T>
163 private details::OptionalStorageBase<sizeof(T),
164 std::alignment_of<T>::value> {
175 details::OptionalStorageBase<sizeof(T),
176 std::alignment_of<T>::value>;
180 using value_type = T;
184 static_assert(!std::is_same<typename std::decay<T>::type, NulloptT>::value,
186 static_assert(!std::is_same<typename std::decay<T>::type, InplaceT>::value,
188 static_assert(!std::is_reference<T>::value,
197 new (&get()) T(other.get()); in Optional()
202 new (&get()) T(std::move(other.get())); in Optional()
209 std::is_constructible<T, U>::value>>
212 new (&get()) T(other.get()); in Optional()
219 std::is_constructible<T, U>::value>>
222 new (&get()) T(std::move(other.get())); in Optional()
227 Optional(const T& value) : base_flag(true) { new (&get()) T(value); } in Optional()
229 Optional(T&& value) : base_flag(true) { new (&get()) T(std::move(value)); } in Optional()
234 new (&get()) T(std::forward<Args>(args)...); in Optional()
240 std::is_constructible<T, std::initializer_list<U>>>>
242 new (&get()) T(il); in Optional()
260 new (&get()) T(other.get());
280 new (&get()) T(std::move(other.get()));
291 class = enable_if_convertible<typename std::decay<U>::type, T>>
302 new (&get()) T(other.get());
313 class = enable_if_convertible<typename std::decay<U>::type, T>>
324 new (&get()) T(std::move(other.get()));
339 T>::value>>
344 new (&get()) T(std::forward<U>(other));
354 T& value() { in value()
361 constexpr const T& value() const { in value()
369 T* ptr() { in ptr()
372 constexpr const T* ptr() const { in ptr()
377 template <class U = T,
378 class = enable_if_convertible<typename std::decay<U>::type, T>>
379 constexpr T valueOr(U&& defaultValue) const { in valueOr()
384 T& operator*() {
391 constexpr const T& operator*() const {
399 T* operator->() {
406 constexpr const T* operator->() const {
428 class = enable_if_convertible<typename std::decay<U>::type, T>>
439 new (&get()) T(std::forward<Args>(args)...); in emplace()
447 std::is_constructible<T, std::initializer_list<U>>>>
452 new (&get()) T(il); in emplace()
458 constexpr const T& get() const { in get()
459 return *reinterpret_cast<const T*>( in get()
464 T& get() { in get()
465 return const_cast<T&>(const_cast<const Optional*>(this)->get()); in get()
469 void destruct() { get().T::~T(); } in destruct()
472 template <class T>
473 Optional<typename std::decay<T>::type> makeOptional(T&& t) { in makeOptional()
474 return Optional<typename std::decay<T>::type>(std::forward<T>(t)); in makeOptional()
477 template <class T, class... Args>
478 Optional<typename std::decay<T>::type> makeOptional(Args&&... args) { in makeOptional()
479 return Optional<typename std::decay<T>::type>(kInplace, in makeOptional()
483 template <class T>
484 bool operator==(const Optional<T>& l, const Optional<T>& r) {
487 template <class T>
488 bool operator==(const Optional<T>& l, NulloptT) {
491 template <class T>
492 bool operator==(NulloptT, const Optional<T>& r) {
495 template <class T>
496 bool operator==(const Optional<T>& l, const T& r) {
499 template <class T>
500 bool operator==(const T& l, const Optional<T>& r) {
504 template <class T>
505 bool operator!=(const Optional<T>& l, const Optional<T>& r) {
508 template <class T>
509 bool operator!=(const Optional<T>& l, NulloptT) {
512 template <class T>
513 bool operator!=(NulloptT, const Optional<T>& r) {
516 template <class T>
517 bool operator!=(const Optional<T>& l, const T& r) {
520 template <class T>
521 bool operator!=(const T& l, const Optional<T>& r) {
525 template <class T>
526 bool operator<(const Optional<T>& l, const Optional<T>& r) {
529 template <class T>
530 bool operator<(const Optional<T>&, NulloptT) {
533 template <class T>
534 bool operator<(NulloptT, const Optional<T>& r) {
537 template <class T>
538 bool operator<(const Optional<T>& l, const T& r) {
541 template <class T>
542 bool operator<(const T& l, const Optional<T>& r) {