Lines Matching refs:value

44 template <typename T, bool = std::is_trivially_destructible<T>::value>
79 // it doesn't contain a value. Union members must be initialized for the
120 // it doesn't contain a value. Union members must be initialized for the
128 // constexpr if is_trivially_{copy,move}_constructible<T>::value is true
134 template <typename T, bool = std::is_trivially_copy_constructible<T>::value,
135 bool = std::is_trivially_move_constructible<T>::value>
263 void InitOrAssign(U&& value) {
265 storage_.value_ = std::forward<U>(value);
267 storage_.Init(std::forward<U>(value));
340 bool, std::is_constructible<T, Optional<U>&>::value ||
341 std::is_constructible<T, const Optional<U>&>::value ||
342 std::is_constructible<T, Optional<U>&&>::value ||
343 std::is_constructible<T, const Optional<U>&&>::value ||
344 std::is_convertible<Optional<U>&, T>::value ||
345 std::is_convertible<const Optional<U>&, T>::value ||
346 std::is_convertible<Optional<U>&&, T>::value ||
347 std::is_convertible<const Optional<U>&&, T>::value> {};
352 bool, IsConvertibleFromOptional<T, U>::value ||
353 std::is_assignable<T&, Optional<U>&>::value ||
354 std::is_assignable<T&, const Optional<U>&>::value ||
355 std::is_assignable<T&, Optional<U>&&>::value ||
356 std::is_assignable<T&, const Optional<U>&&>::value> {};
419 public internal::CopyConstructible<std::is_copy_constructible<T>::value>,
420 public internal::MoveConstructible<std::is_move_constructible<T>::value>,
421 public internal::CopyAssignable<std::is_copy_constructible<T>::value &&
422 std::is_copy_assignable<T>::value>,
423 public internal::MoveAssignable<std::is_move_constructible<T>::value &&
424 std::is_move_assignable<T>::value> {
437 // std::is_convertible<const U&, T>::value is false. It is implemented by
442 std::is_constructible<T, const U&>::value &&
443 !internal::IsConvertibleFromOptional<T, U>::value &&
444 std::is_convertible<const U&, T>::value,
451 std::is_constructible<T, const U&>::value &&
452 !internal::IsConvertibleFromOptional<T, U>::value &&
453 !std::is_convertible<const U&, T>::value,
462 std::is_constructible<T, U&&>::value &&
463 !internal::IsConvertibleFromOptional<T, U>::value &&
464 std::is_convertible<U&&, T>::value,
471 std::is_constructible<T, U&&>::value &&
472 !internal::IsConvertibleFromOptional<T, U>::value &&
473 !std::is_convertible<U&&, T>::value,
484 value_type, std::initializer_list<U>&, Args...>::value>::type>
489 // Forward value constructor. Similar to converting constructors,
494 std::is_constructible<T, U&&>::value &&
495 !std::is_same<internal::RemoveCvRefT<U>, in_place_t>::value &&
496 !std::is_same<internal::RemoveCvRefT<U>, Optional<T>>::value &&
497 std::is_convertible<U&&, T>::value,
499 constexpr Optional(U&& value) // NOLINT(runtime/explicit)
500 : internal::OptionalBase<T>(in_place, std::forward<U>(value)) {}
505 std::is_constructible<T, U&&>::value &&
506 !std::is_same<internal::RemoveCvRefT<U>, in_place_t>::value &&
507 !std::is_same<internal::RemoveCvRefT<U>, Optional<T>>::value &&
508 !std::is_convertible<U&&, T>::value,
510 constexpr explicit Optional(U&& value)
511 : internal::OptionalBase<T>(in_place, std::forward<U>(value)) {}
527 !std::is_same<internal::RemoveCvRefT<U>, Optional<T>>::value &&
528 std::is_constructible<T, U>::value &&
529 std::is_assignable<T&, U>::value &&
530 (!std::is_scalar<T>::value ||
531 !std::is_same<typename std::decay<U>::type, T>::value),
533 operator=(U&& value) V8_NOEXCEPT {
534 InitOrAssign(std::forward<U>(value));
540 typename std::enable_if<!internal::IsAssignableFromOptional<T, U>::value &&
541 std::is_constructible<T, const U&>::value &&
542 std::is_assignable<T&, const U&>::value,
551 typename std::enable_if<!internal::IsAssignableFromOptional<T, U>::value &&
552 std::is_constructible<T, U>::value &&
553 std::is_assignable<T&, U>::value,
594 T& value() & {
599 const T& value() const & {
604 T&& value() && {
609 const T&& value() const && {
617 // static_assert(std::is_copy_constructible<T>::value,
619 static_assert(std::is_convertible<U, T>::value,
629 // static_assert(std::is_move_constructible<T>::value,
631 static_assert(std::is_convertible<U, T>::value,
668 std::is_constructible<T, std::initializer_list<U>&, Args&&...>::value,
793 constexpr bool operator==(const Optional<T>& opt, const U& value) {
794 return opt.has_value() ? *opt == value : false;
798 constexpr bool operator==(const U& value, const Optional<T>& opt) {
799 return opt.has_value() ? value == *opt : false;
803 constexpr bool operator!=(const Optional<T>& opt, const U& value) {
804 return opt.has_value() ? *opt != value : true;
808 constexpr bool operator!=(const U& value, const Optional<T>& opt) {
809 return opt.has_value() ? value != *opt : true;
813 constexpr bool operator<(const Optional<T>& opt, const U& value) {
814 return opt.has_value() ? *opt < value : true;
818 constexpr bool operator<(const U& value, const Optional<T>& opt) {
819 return opt.has_value() ? value < *opt : false;
823 constexpr bool operator<=(const Optional<T>& opt, const U& value) {
824 return opt.has_value() ? *opt <= value : true;
828 constexpr bool operator<=(const U& value, const Optional<T>& opt) {
829 return opt.has_value() ? value <= *opt : false;
833 constexpr bool operator>(const Optional<T>& opt, const U& value) {
834 return opt.has_value() ? *opt > value : false;
838 constexpr bool operator>(const U& value, const Optional<T>& opt) {
839 return opt.has_value() ? value > *opt : true;
843 constexpr bool operator>=(const Optional<T>& opt, const U& value) {
844 return opt.has_value() ? *opt >= value : false;
848 constexpr bool operator>=(const U& value, const Optional<T>& opt) {
849 return opt.has_value() ? value >= *opt : true;
853 constexpr Optional<typename std::decay<T>::type> make_optional(T&& value) {
854 return Optional<typename std::decay<T>::type>(std::forward<T>(value));
873 typename std::enable_if<std::is_move_constructible<T>::value &&
874 internal::IsSwappable<T>::value>::type