• Home
  • Raw
  • Download

Lines Matching refs:T

144 template <class T>
157 template <class T>
160 private details::OptionalStorageBase<sizeof(T),
161 std::alignment_of<T>::value> {
172 details::OptionalStorageBase<sizeof(T),
173 std::alignment_of<T>::value>;
177 using value_type = T;
181 static_assert(!std::is_same<typename std::decay<T>::type, NulloptT>::value,
183 static_assert(!std::is_same<typename std::decay<T>::type, InplaceT>::value,
185 static_assert(!std::is_reference<T>::value,
194 new (&get()) T(other.get()); in Optional()
199 new (&get()) T(std::move(other.get())); in Optional()
206 std::is_constructible<T, U>::value>>
209 new (&get()) T(other.get()); in Optional()
216 std::is_constructible<T, U>::value>>
219 new (&get()) T(std::move(other.get())); in Optional()
224 Optional(const T& value) : base_flag(true) { new (&get()) T(value); } in Optional()
226 Optional(T&& value) : base_flag(true) { new (&get()) T(std::move(value)); } in Optional()
231 new (&get()) T(std::forward<Args>(args)...); in Optional()
237 std::is_constructible<T, std::initializer_list<U>>>>
239 new (&get()) T(il); in Optional()
257 new (&get()) T(other.get());
277 new (&get()) T(std::move(other.get()));
288 class = enable_if_convertible<typename std::decay<U>::type, T>>
299 new (&get()) T(other.get());
310 class = enable_if_convertible<typename std::decay<U>::type, T>>
321 new (&get()) T(std::move(other.get()));
336 T>::value>>
341 new (&get()) T(std::forward<U>(other));
351 T& value() { in value()
358 constexpr const T& value() const { in value()
366 T* ptr() { in ptr()
369 constexpr const T* ptr() const { in ptr()
374 template <class U = T,
375 class = enable_if_convertible<typename std::decay<U>::type, T>>
376 constexpr T valueOr(U&& defaultValue) const { in valueOr()
381 T& operator*() {
388 constexpr const T& operator*() const {
396 T* operator->() {
403 constexpr const T* operator->() const {
425 class = enable_if_convertible<typename std::decay<U>::type, T>>
436 new (&get()) T(std::forward<Args>(args)...); in emplace()
444 std::is_constructible<T, std::initializer_list<U>>>>
449 new (&get()) T(il); in emplace()
455 constexpr const T& get() const { in get()
456 return *reinterpret_cast<const T*>( in get()
461 T& get() { in get()
462 return const_cast<T&>(const_cast<const Optional*>(this)->get()); in get()
466 void destruct() { get().T::~T(); } in destruct()
469 template <class T>
470 Optional<typename std::decay<T>::type> makeOptional(T&& t) { in makeOptional()
471 return Optional<typename std::decay<T>::type>(std::forward<T>(t)); in makeOptional()
474 template <class T, class... Args>
475 Optional<typename std::decay<T>::type> makeOptional(Args&&... args) { in makeOptional()
476 return Optional<typename std::decay<T>::type>(kInplace, in makeOptional()
480 template <class T>
481 bool operator==(const Optional<T>& l, const Optional<T>& r) {
484 template <class T>
485 bool operator==(const Optional<T>& l, NulloptT) {
488 template <class T>
489 bool operator==(NulloptT, const Optional<T>& r) {
492 template <class T>
493 bool operator==(const Optional<T>& l, const T& r) {
496 template <class T>
497 bool operator==(const T& l, const Optional<T>& r) {
501 template <class T>
502 bool operator!=(const Optional<T>& l, const Optional<T>& r) {
505 template <class T>
506 bool operator!=(const Optional<T>& l, NulloptT) {
509 template <class T>
510 bool operator!=(NulloptT, const Optional<T>& r) {
513 template <class T>
514 bool operator!=(const Optional<T>& l, const T& r) {
517 template <class T>
518 bool operator!=(const T& l, const Optional<T>& r) {
522 template <class T>
523 bool operator<(const Optional<T>& l, const Optional<T>& r) {
526 template <class T>
527 bool operator<(const Optional<T>&, NulloptT) {
530 template <class T>
531 bool operator<(NulloptT, const Optional<T>& r) {
534 template <class T>
535 bool operator<(const Optional<T>& l, const T& r) {
538 template <class T>
539 bool operator<(const T& l, const Optional<T>& r) {