Lines Matching refs:T

50 template <typename T> T && declval() noexcept;
52 template <bool Cond, typename T = void> struct enable_if;
53 template <typename T> struct enable_if<true, T> { using type = T; };
54 template <bool Cond, typename T = void> using enable_if_t = typename enable_if<Cond, T>::type;
58 template <typename T> inline constexpr bool is_void_v = false;
62 template <typename T, typename U> struct copy_const { using type = U; };
63 template <typename T, typename U> struct copy_const<T const, U> { using type = U const; };
64 template <typename T, typename U> using copy_const_t = typename copy_const<T, U>::type;
66 template <typename T, typename U> struct copy_cv { using type = U; };
67 template <typename T, typename U> struct copy_cv<T const, U> { using type = U const; };
68 template <typename T, typename U> struct copy_cv<T volatile, U> { using type = U volatile; };
69 template <typename T, typename U> struct copy_cv<T const volatile, U> { using type = U const volati…
70 template <typename T, typename U> using copy_cv_t = typename copy_cv<T, U>::type;
72 template <typename T, typename U>
74 decltype(declval<T>() == declval<U>()),
75 decltype(declval<T>() != declval<U>())
78 template <typename T, typename U>
80 decltype(declval<T>() < declval<U>()),
81 decltype(declval<T>() > declval<U>()),
82 decltype(declval<T>() >= declval<U>()),
83 decltype(declval<T>() <= declval<U>())
88 template <typename T> constexpr size_t sizeof_v = sizeof(T);
144 template <typename T, typename TrappingPolicy>
147 using CharType = detail::copy_cv_t<T, char>;
180 bounded_ptr(T* pointer, T const* begin, T const* end)
182 base_ = reinterpret_cast<CharType*>(const_cast<T*>(begin));
214 …e <typename U, typename Policy, typename = detail::enable_if_t<detail::is_convertible_v<U*, T*> > >
219 …, offset_(static_cast<int32_t>(reinterpret_cast<CharType*>(static_cast<T*>(other.get_ptr_())) - ot…
229 …e <typename U, typename Policy, typename = detail::enable_if_t<detail::is_convertible_v<U*, T*> > >
235 …offset_ = static_cast<int32_t>(reinterpret_cast<CharType*>(static_cast<T*>(other.get_ptr_())) - ot…
261 …template <typename T_ = T> // delay instantiation to avoid forming invalid ref for bounded_ptr<voi…
272 OS_ALWAYS_INLINE T*
288 …template <typename T_ = T> // delay instantiation to avoid forming invalid ref for bounded_ptr<voi…
300 OS_ALWAYS_INLINE T*
324 OS_ALWAYS_INLINE T*
387 template <typename T_ = T>
394 if (__improbable(os_mul_overflow(n, sizeof(T), &bytes))) {
407 template <typename T_ = T>
414 if (__improbable(os_mul_overflow(n, sizeof(T), &bytes))) {
458 operator-(bounded_ptr const& a, T const* b)
464 operator-(T const* a, bounded_ptr const& b)
473 static_assert(detail::sizeof_v<T> <= UINT32_MAX - INT32_MAX,
476 …return offset_ >= 0 && static_cast<uint32_t>(offset_) + static_cast<uint32_t>(detail::sizeof_v<T>)…
479 OS_ALWAYS_INLINE T*
488 return reinterpret_cast<T*>(ptr);
512 template <typename T, typename P1, typename U, typename P2, typename = detail::WhenComparable<T*, U…
514 operator==(bounded_ptr<T, P1> const& a, bounded_ptr<U, P2> const& b)
519 template <typename T, typename P1, typename U, typename P2, typename = detail::WhenComparable<T*, U…
521 operator!=(bounded_ptr<T, P1> const& a, bounded_ptr<U, P2> const& b)
526 template <typename T, typename P, typename U, typename = detail::WhenComparable<T*, U*> >
528 operator==(bounded_ptr<T, P> const& a, U* b)
533 template <typename T, typename P, typename U, typename = detail::WhenComparable<T*, U*> >
535 operator==(U* a, bounded_ptr<T, P> const& b)
540 template <typename T, typename P, typename U, typename = detail::WhenComparable<T*, U*> >
542 operator!=(bounded_ptr<T, P> const& a, U* b)
547 template <typename T, typename P, typename U, typename = detail::WhenComparable<T*, U*> >
549 operator!=(U* a, bounded_ptr<T, P> const& b)
554 template <typename T, typename Policy>
556 operator==(detail::nullptr_t, bounded_ptr<T, Policy> const& p)
561 template <typename T, typename Policy>
563 operator!=(detail::nullptr_t, bounded_ptr<T, Policy> const& p)
568 template <typename T, typename Policy>
570 operator==(bounded_ptr<T, Policy> const& p, detail::nullptr_t)
575 template <typename T, typename Policy>
577 operator!=(bounded_ptr<T, Policy> const& p, detail::nullptr_t)
597 template <typename T, typename U, typename P1, typename P2, typename = detail::WhenOrderable<T*, U*…
599 operator<(bounded_ptr<T, P1> const& a, bounded_ptr<U, P2> const& b)
604 template <typename T, typename U, typename P1, typename P2, typename = detail::WhenOrderable<T*, U*…
606 operator<=(bounded_ptr<T, P1> const& a, bounded_ptr<U, P2> const& b)
611 template <typename T, typename U, typename P1, typename P2, typename = detail::WhenOrderable<T*, U*…
613 operator>(bounded_ptr<T, P1> const& a, bounded_ptr<U, P2> const& b)
618 template <typename T, typename U, typename P1, typename P2, typename = detail::WhenOrderable<T*, U*…
620 operator>=(bounded_ptr<T, P1> const& a, bounded_ptr<U, P2> const& b)
625 template <typename T, typename U, typename P, typename = detail::WhenOrderable<T*, U*> >
627 operator<(T* a, bounded_ptr<U, P> const& b)
632 template <typename T, typename U, typename P, typename = detail::WhenOrderable<T*, U*> >
634 operator<(bounded_ptr<T, P> const& a, U* b)
639 template <typename T, typename U, typename P, typename = detail::WhenOrderable<T*, U*> >
641 operator<=(T* a, bounded_ptr<U, P> const& b)
646 template <typename T, typename U, typename P, typename = detail::WhenOrderable<T*, U*> >
648 operator<=(bounded_ptr<T, P> const& a, U* b)
653 template <typename T, typename U, typename P, typename = detail::WhenOrderable<T*, U*> >
655 operator>(T* a, bounded_ptr<U, P> const& b)
660 template <typename T, typename U, typename P, typename = detail::WhenOrderable<T*, U*> >
662 operator>(bounded_ptr<T, P> const& a, U* b)
667 template <typename T, typename U, typename P, typename = detail::WhenOrderable<T*, U*> >
669 operator>=(T* a, bounded_ptr<U, P> const& b)
674 template <typename T, typename U, typename P, typename = detail::WhenOrderable<T*, U*> >
676 operator>=(bounded_ptr<T, P> const& a, U* b)
681 template <typename T, typename U>
682 OS_ALWAYS_INLINE T*
685 return reinterpret_cast<T*>(p);
695 template <typename T, typename U, typename Policy>
696 OS_ALWAYS_INLINE bounded_ptr<T, Policy>
699 using CharType = detail::copy_cv_t<T, char>;
702 return bounded_ptr<T, Policy>(reinterpret_cast<T*>(p.get_ptr_()),
703 reinterpret_cast<T const*>(new_begin),
704 reinterpret_cast<T const*>(new_end));