HDK
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
UT_Span.h
Go to the documentation of this file.
1 /*
2  * PROPRIETARY INFORMATION. This software is proprietary to
3  * Side Effects Software Inc., and is not to be reproduced,
4  * transmitted, or disclosed in any way without written permission.
5  *
6  * NAME: UT_Span.h ( UT Library, C++)
7  *
8  * COMMENTS:
9  */
10 
11 #ifndef __UT_Span__
12 #define __UT_Span__
13 
14 #include "UT_Assert.h"
15 
16 // Define Houdini specific namespace
17 #ifndef TCB_SPAN_NAMESPACE_NAME
18 #define TCB_SPAN_NAMESPACE_NAME UT::tcb
19 #endif
20 
21 ///----------------------------------------------------------------------------
22 /// @{
23 /// Source from https://github.com/tcbrindle/span
24 ///----------------------------------------------------------------------------
25 /*
26 This is an implementation of C++20's std::span
27 http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/n4820.pdf
28 */
29 
30 // Copyright Tristan Brindle 2018.
31 // Distributed under the Boost Software License, Version 1.0.
32 // (See accompanying file ../../LICENSE_1_0.txt or copy at
33 // https://www.boost.org/LICENSE_1_0.txt)
34 
35 #ifndef TCB_SPAN_HPP_INCLUDED
36 #define TCB_SPAN_HPP_INCLUDED
37 
38 #include <array>
39 #include <cstddef>
40 #include <cstdint>
41 #include <type_traits>
42 
43 #ifndef TCB_SPAN_NO_EXCEPTIONS
44 // Attempt to discover whether we're being compiled with exception support
45 #if !(defined(__cpp_exceptions) || defined(__EXCEPTIONS) || defined(_CPPUNWIND))
46 #define TCB_SPAN_NO_EXCEPTIONS
47 #endif
48 #endif
49 
50 #ifndef TCB_SPAN_NO_EXCEPTIONS
51 #include <cstdio>
52 #include <stdexcept>
53 #endif
54 
55 // Various feature test macros
56 
57 #ifndef TCB_SPAN_NAMESPACE_NAME
58 #define TCB_SPAN_NAMESPACE_NAME tcb
59 #endif
60 
61 #if __cplusplus >= 201703L || (defined(_MSVC_LANG) && _MSVC_LANG >= 201703L)
62 #define TCB_SPAN_HAVE_CPP17
63 #endif
64 
65 #if __cplusplus >= 201402L || (defined(_MSVC_LANG) && _MSVC_LANG >= 201402L)
66 #define TCB_SPAN_HAVE_CPP14
67 #endif
68 
70 
71 // Establish default contract checking behavior
72 #if !defined(TCB_SPAN_THROW_ON_CONTRACT_VIOLATION) && \
73  !defined(TCB_SPAN_TERMINATE_ON_CONTRACT_VIOLATION) && \
74  !defined(TCB_SPAN_NO_CONTRACT_CHECKING)
75 #if defined(NDEBUG) || !defined(TCB_SPAN_HAVE_CPP14)
76 #define TCB_SPAN_NO_CONTRACT_CHECKING
77 #else
78 #define TCB_SPAN_TERMINATE_ON_CONTRACT_VIOLATION
79 #endif
80 #endif
81 
82 #if defined(TCB_SPAN_THROW_ON_CONTRACT_VIOLATION)
83 struct contract_violation_error : std::logic_error {
84  explicit contract_violation_error(const char* msg) : std::logic_error(msg)
85  {}
86 };
87 
88 inline void contract_violation(const char* msg)
89 {
90  throw contract_violation_error(msg);
91 }
92 
93 #elif defined(TCB_SPAN_TERMINATE_ON_CONTRACT_VIOLATION)
94 [[noreturn]] inline void contract_violation(const char* /*unused*/)
95 {
96  std::terminate();
97 }
98 #endif
99 
100 #if 0
101 #if !defined(TCB_SPAN_NO_CONTRACT_CHECKING)
102 #define TCB_SPAN_STRINGIFY(cond) #cond
103 #define TCB_SPAN_EXPECT(cond) \
104  cond ? (void) 0 : contract_violation("Expected " TCB_SPAN_STRINGIFY(cond))
105 #else
106 #define TCB_SPAN_EXPECT(cond)
107 #endif
108 #else
109 #define TCB_SPAN_EXPECT(cond) UT_ASSERT(cond)
110 #endif
111 
112 #if defined(TCB_SPAN_HAVE_CPP17) || defined(__cpp_inline_variables)
113 #define TCB_SPAN_INLINE_VAR inline
114 #else
115 #define TCB_SPAN_INLINE_VAR
116 #endif
117 
118 #if defined(TCB_SPAN_HAVE_CPP14) || \
119  (defined(__cpp_constexpr) && __cpp_constexpr >= 201304)
120 #define TCB_SPAN_HAVE_CPP14_CONSTEXPR
121 #endif
122 
123 #if defined(TCB_SPAN_HAVE_CPP14_CONSTEXPR)
124 #define TCB_SPAN_CONSTEXPR14 constexpr
125 #else
126 #define TCB_SPAN_CONSTEXPR14
127 #endif
128 
129 #if defined(TCB_SPAN_HAVE_CPP14_CONSTEXPR) && \
130  (!defined(_MSC_VER) || _MSC_VER > 1900)
131 #define TCB_SPAN_CONSTEXPR_ASSIGN constexpr
132 #else
133 #define TCB_SPAN_CONSTEXPR_ASSIGN
134 #endif
135 
136 #if defined(TCB_SPAN_NO_CONTRACT_CHECKING)
137 #define TCB_SPAN_CONSTEXPR11 constexpr
138 #else
139 #define TCB_SPAN_CONSTEXPR11 TCB_SPAN_CONSTEXPR14
140 #endif
141 
142 #if defined(TCB_SPAN_HAVE_CPP17) || defined(__cpp_deduction_guides)
143 #define TCB_SPAN_HAVE_DEDUCTION_GUIDES
144 #endif
145 
146 #if defined(TCB_SPAN_HAVE_CPP17) || defined(__cpp_lib_byte)
147 #define TCB_SPAN_HAVE_STD_BYTE
148 #endif
149 
150 #if defined(TCB_SPAN_HAVE_CPP17) || defined(__cpp_lib_array_constexpr)
151 #define TCB_SPAN_HAVE_CONSTEXPR_STD_ARRAY_ETC
152 #endif
153 
154 #if defined(TCB_SPAN_HAVE_CONSTEXPR_STD_ARRAY_ETC)
155 #define TCB_SPAN_ARRAY_CONSTEXPR constexpr
156 #else
157 #define TCB_SPAN_ARRAY_CONSTEXPR
158 #endif
159 
160 #ifdef TCB_SPAN_HAVE_STD_BYTE
161 using byte = std::byte;
162 #else
163 using byte = unsigned char;
164 #endif
165 
166 #if defined(TCB_SPAN_HAVE_CPP17)
167 #define TCB_SPAN_NODISCARD [[nodiscard]]
168 #else
169 #define TCB_SPAN_NODISCARD
170 #endif
171 
172 TCB_SPAN_INLINE_VAR constexpr std::size_t dynamic_extent = SIZE_MAX;
173 
174 template <typename ElementType, std::size_t Extent = dynamic_extent>
175 class span;
176 
177 namespace detail {
178 
179 template <typename E, std::size_t S>
180 struct span_storage {
181  constexpr span_storage() noexcept = default;
182 
183  constexpr span_storage(E* p_ptr, std::size_t /*unused*/) noexcept
184  : ptr(p_ptr)
185  {}
186 
187  E* ptr = nullptr;
188  static constexpr std::size_t size = S;
189 };
190 
191 template <typename E>
193  constexpr span_storage() noexcept = default;
194 
195  constexpr span_storage(E* p_ptr, std::size_t p_size) noexcept
196  : ptr(p_ptr), size(p_size)
197  {}
198 
199  E* ptr = nullptr;
200  std::size_t size = 0;
201 };
202 
203 // Reimplementation of C++17 std::size() and std::data()
204 #if defined(TCB_SPAN_HAVE_CPP17) || \
205  defined(__cpp_lib_nonmember_container_access)
206 using std::data;
207 using std::size;
208 #else
209 template <class C>
210 constexpr auto size(const C& c) -> decltype(c.size())
211 {
212  return c.size();
213 }
214 
215 template <class T, std::size_t N>
216 constexpr std::size_t size(const T (&)[N]) noexcept
217 {
218  return N;
219 }
220 
221 template <class C>
222 constexpr auto data(C& c) -> decltype(c.data())
223 {
224  return c.data();
225 }
226 
227 template <class C>
228 constexpr auto data(const C& c) -> decltype(c.data())
229 {
230  return c.data();
231 }
232 
233 template <class T, std::size_t N>
234 constexpr T* data(T (&array)[N]) noexcept
235 {
236  return array;
237 }
238 
239 template <class E>
240 constexpr const E* data(std::initializer_list<E> il) noexcept
241 {
242  return il.begin();
243 }
244 #endif // TCB_SPAN_HAVE_CPP17
245 
246 #if defined(TCB_SPAN_HAVE_CPP17) || defined(__cpp_lib_void_t)
247 using std::void_t;
248 #else
249 template <typename...>
250 using void_t = void;
251 #endif
252 
253 template <typename T>
254 using uncvref_t =
256 
257 template <typename>
258 struct is_span : std::false_type {};
259 
260 template <typename T, std::size_t S>
261 struct is_span<span<T, S>> : std::true_type {};
262 
263 template <typename>
264 struct is_std_array : std::false_type {};
265 
266 template <typename T, std::size_t N>
267 struct is_std_array<std::array<T, N>> : std::true_type {};
268 
269 template <typename, typename = void>
270 struct has_size_and_data : std::false_type {};
271 
272 template <typename T>
273 struct has_size_and_data<T, void_t<decltype(detail::size(std::declval<T>())),
274  decltype(detail::data(std::declval<T>()))>>
275  : std::true_type {};
276 
277 template <typename C, typename U = uncvref_t<C>>
278 struct is_container {
279  static constexpr bool value =
282 };
283 
284 template <typename T>
286 
287 template <typename, typename, typename = void>
288 struct is_container_element_type_compatible : std::false_type {};
289 
290 template <typename T, typename E>
292  T, E,
293  typename std::enable_if<
294  !std::is_same<
295  typename std::remove_cv<decltype(detail::data(std::declval<T>()))>::type,
296  void>::value &&
297  std::is_convertible<
298  remove_pointer_t<decltype(detail::data(std::declval<T>()))> (*)[],
299  E (*)[]>::value
300  >::type>
301  : std::true_type {};
302 
303 template <typename, typename = size_t>
304 struct is_complete : std::false_type {};
305 
306 template <typename T>
307 struct is_complete<T, decltype(sizeof(T))> : std::true_type {};
308 
309 } // namespace detail
310 
311 template <typename ElementType, std::size_t Extent>
312 class span {
314  "A span's ElementType must be an object type (not a "
315  "reference type or void)");
317  "A span's ElementType must be a complete type (not a forward "
318  "declaration)");
320  "A span's ElementType cannot be an abstract class type");
321 
322  using storage_type = detail::span_storage<ElementType, Extent>;
323 
324 public:
325  // constants and types
326  using element_type = ElementType;
328  using size_type = std::size_t;
329  using difference_type = std::ptrdiff_t;
331  using const_pointer = const element_type*;
334  using iterator = pointer;
335  using reverse_iterator = std::reverse_iterator<iterator>;
336 
337  static constexpr size_type extent = Extent;
338 
339  // [span.cons], span constructors, copy, assignment, and destructor
340  template <
341  std::size_t E = Extent,
343  constexpr span() noexcept
344  {}
345 
347  : storage_(ptr, count)
348  {
350  }
351 
352  TCB_SPAN_CONSTEXPR11 span(pointer first_elem, pointer last_elem)
353  : storage_(first_elem, last_elem - first_elem)
354  {
356  last_elem - first_elem ==
357  static_cast<std::ptrdiff_t>(extent));
358  }
359 
360  template <std::size_t N, std::size_t E = Extent,
361  typename std::enable_if<
362  (E == dynamic_extent || N == E) &&
364  element_type (&)[N], ElementType>::value,
365  int>::type = 0>
366  constexpr span(element_type (&arr)[N]) noexcept : storage_(arr, N)
367  {}
368 
369  template <typename T, std::size_t N, std::size_t E = Extent,
370  typename std::enable_if<
371  (E == dynamic_extent || N == E) &&
373  std::array<T, N>&, ElementType>::value,
374  int>::type = 0>
375  TCB_SPAN_ARRAY_CONSTEXPR span(std::array<T, N>& arr) noexcept
376  : storage_(arr.data(), N)
377  {}
378 
379  template <typename T, std::size_t N, std::size_t E = Extent,
380  typename std::enable_if<
381  (E == dynamic_extent || N == E) &&
383  const std::array<T, N>&, ElementType>::value,
384  int>::type = 0>
385  TCB_SPAN_ARRAY_CONSTEXPR span(const std::array<T, N>& arr) noexcept
386  : storage_(arr.data(), N)
387  {}
388 
389  template <
390  typename Container, std::size_t E = Extent,
391  typename std::enable_if<
394  Container&, ElementType>::value,
395  int>::type = 0>
396  constexpr span(Container& cont)
397  : storage_(detail::data(cont), detail::size(cont))
398  {}
399 
400  template <
401  typename Container, std::size_t E = Extent,
402  typename std::enable_if<
405  const Container&, ElementType>::value,
406  int>::type = 0>
407  constexpr span(const Container& cont)
408  : storage_(detail::data(cont), detail::size(cont))
409  {}
410 
411  constexpr span(const span& other) noexcept = default;
412 
413  template <typename OtherElementType, std::size_t OtherExtent,
414  typename std::enable_if<
415  (Extent == dynamic_extent || OtherExtent == dynamic_extent ||
416  Extent == OtherExtent) &&
417  std::is_convertible<OtherElementType (*)[],
418  ElementType (*)[]>::value,
419  int>::type = 0>
420  constexpr span(const span<OtherElementType, OtherExtent>& other) noexcept
421  : storage_(other.data(), other.size())
422  {}
423 
424  ~span() noexcept = default;
425 
427  operator=(const span& other) noexcept = default;
428 
429  // [span.sub], span subviews
430  template <std::size_t Count>
432  {
433  TCB_SPAN_EXPECT(Count <= size());
434  return {data(), Count};
435  }
436 
437  template <std::size_t Count>
439  {
440  TCB_SPAN_EXPECT(Count <= size());
441  return {data() + (size() - Count), Count};
442  }
443 
444  template <std::size_t Offset, std::size_t Count = dynamic_extent>
445  using subspan_return_t =
446  span<ElementType, Count != dynamic_extent
447  ? Count
448  : (Extent != dynamic_extent ? Extent - Offset
450 
451  template <std::size_t Offset, std::size_t Count = dynamic_extent>
453  {
454  TCB_SPAN_EXPECT(Offset <= size() &&
455  (Count == dynamic_extent || Offset + Count <= size()));
456  return {data() + Offset,
457  Count != dynamic_extent ? Count : size() - Offset};
458  }
459 
462  {
463  TCB_SPAN_EXPECT(count <= size());
464  return {data(), count};
465  }
466 
469  {
470  TCB_SPAN_EXPECT(count <= size());
471  return {data() + (size() - count), count};
472  }
473 
476  {
477  TCB_SPAN_EXPECT(offset <= size() &&
478  (count == dynamic_extent || offset + count <= size()));
479  return {data() + offset,
480  count == dynamic_extent ? size() - offset : count};
481  }
482 
483  // [span.obs], span observers
484  constexpr size_type size() const noexcept { return storage_.size; }
485 
486  constexpr size_type size_bytes() const noexcept
487  {
488  return size() * sizeof(element_type);
489  }
490 
491  TCB_SPAN_NODISCARD constexpr bool empty() const noexcept
492  {
493  return size() == 0;
494  }
495 
496  // [span.elem], span element access
498  {
499  TCB_SPAN_EXPECT(idx < size());
500  return *(data() + idx);
501  }
502 
504  {
506  return *data();
507  }
508 
510  {
512  return *(data() + (size() - 1));
513  }
514 
515  constexpr pointer data() const noexcept { return storage_.ptr; }
516 
517  // [span.iterators], span iterator support
518  constexpr iterator begin() const noexcept { return data(); }
519 
520  constexpr iterator end() const noexcept { return data() + size(); }
521 
523  {
524  return reverse_iterator(end());
525  }
526 
528  {
529  return reverse_iterator(begin());
530  }
531 
532 private:
533  storage_type storage_{};
534 };
535 
536 #ifdef TCB_SPAN_HAVE_DEDUCTION_GUIDES
537 
538 /* Deduction Guides */
539 template <class T, size_t N>
540 span(T (&)[N])->span<T, N>;
541 
542 template <class T, size_t N>
543 span(std::array<T, N>&)->span<T, N>;
544 
545 template <class T, size_t N>
546 span(const std::array<T, N>&)->span<const T, N>;
547 
548 template <class Container>
549 span(Container&)->span<typename std::remove_reference<
550  decltype(*detail::data(std::declval<Container&>()))>::type>;
551 
552 template <class Container>
553 span(const Container&)->span<const typename Container::value_type>;
554 
555 #endif // TCB_HAVE_DEDUCTION_GUIDES
556 
557 template <typename ElementType, std::size_t Extent>
560 {
561  return s;
562 }
563 
564 template <typename T, std::size_t N>
565 constexpr span<T, N> make_span(T (&arr)[N]) noexcept
566 {
567  return {arr};
568 }
569 
570 template <typename T, std::size_t N>
571 TCB_SPAN_ARRAY_CONSTEXPR span<T, N> make_span(std::array<T, N>& arr) noexcept
572 {
573  return {arr};
574 }
575 
576 template <typename T, std::size_t N>
578 make_span(const std::array<T, N>& arr) noexcept
579 {
580  return {arr};
581 }
582 
583 template <typename Container>
584 constexpr span<typename std::remove_reference<
585  decltype(*detail::data(std::declval<Container&>()))>::type>
586 make_span(Container& cont)
587 {
588  return {cont};
589 }
590 
591 template <typename Container>
593 make_span(const Container& cont)
594 {
595  return {cont};
596 }
597 
598 template <typename ElementType, std::size_t Extent>
599 span<const byte, ((Extent == dynamic_extent) ? dynamic_extent
600  : sizeof(ElementType) * Extent)>
602 {
603  return {reinterpret_cast<const byte*>(s.data()), s.size_bytes()};
604 }
605 
606 template <
607  class ElementType, size_t Extent,
608  typename std::enable_if<!std::is_const<ElementType>::value, int>::type = 0>
609 span<byte, ((Extent == dynamic_extent) ? dynamic_extent
610  : sizeof(ElementType) * Extent)>
612 {
613  return {reinterpret_cast<byte*>(s.data()), s.size_bytes()};
614 }
615 
616 template <std::size_t N, typename E, std::size_t S>
617 constexpr auto get(span<E, S> s) -> decltype(s[N])
618 {
619  return s[N];
620 }
621 
622 } // namespace TCB_SPAN_NAMESPACE_NAME
623 
624 namespace std {
625 
626 #ifdef __clang__
627 #pragma clang diagnostic push
628 #pragma clang diagnostic ignored "-Wmismatched-tags"
629 #endif
630 
631 template <typename ElementType, size_t Extent>
632 class tuple_size<TCB_SPAN_NAMESPACE_NAME::span<ElementType, Extent>>
633  : public integral_constant<size_t, Extent> {};
634 
635 template <typename ElementType>
636 class tuple_size<TCB_SPAN_NAMESPACE_NAME::span<
637  ElementType, TCB_SPAN_NAMESPACE_NAME::dynamic_extent>>; // not defined
638 
639 template <size_t I, typename ElementType, size_t Extent>
640 class tuple_element<I, TCB_SPAN_NAMESPACE_NAME::span<ElementType, Extent>> {
641 public:
642  static_assert(Extent != TCB_SPAN_NAMESPACE_NAME::dynamic_extent &&
643  I < Extent,
644  "");
645  using type = ElementType;
646 };
647 
648 #ifdef __clang__
649 #pragma clang diagnostic pop
650 #endif
651 
652 } // end namespace std
653 
654 #endif // TCB_SPAN_HPP_INCLUDED
655 ///----------------------------------------------------------------------------
656 /// @}
657 /// End of source from https://github.com/tcbrindle/span
658 ///----------------------------------------------------------------------------
659 
660 template <typename ElementType,
661  std::size_t Extent=TCB_SPAN_NAMESPACE_NAME::dynamic_extent>
663 
664 /// @{
665 /// Define equality operations
666 
667 template <typename SPANL, typename SPANR> struct UT_DeepEqual;
668 template <typename SPANL, typename SPANR> struct UT_ShallowEqual;
669 
670 template <typename ElementType,
671  std::size_t ExtentL,
672  std::size_t ExtentR>
673 struct UT_DeepEqual<UT_Span<ElementType, ExtentL>, UT_Span<ElementType, ExtentR>>
674 {
677  constexpr bool operator()(const SPANL &left, const SPANR &right) const
678  {
679  if (left.size() != right.size())
680  return false;
681  if (left.data() == right.data())
682  return true;
683  return std::equal(left.begin(), left.end(), right.begin(), right.end());
684  }
685 };
686 
687 template <typename ElementType,
688  std::size_t ExtentL,
689  std::size_t ExtentR>
690 struct UT_ShallowEqual<UT_Span<ElementType, ExtentL>, UT_Span<ElementType, ExtentR>>
691 {
694  constexpr bool operator()(const SPANL &left, const SPANR &right) const
695  {
696  if (left.size() != right.size())
697  return false;
698  return left.data() == right.data();
699  }
700 };
701 
702 template <typename SPANL, typename SPANR>
703 constexpr bool
704 UTdeepEqual(const SPANL &left, const SPANR &right)
705 {
706  return UT_DeepEqual<SPANL, SPANR>()(left, right);
707 }
708 
709 template <typename SPANL, typename SPANR>
710 constexpr bool
711 UTshallowEqual(const SPANL &left, const SPANR &right)
712 {
713  return UT_ShallowEqual<SPANL, SPANR>()(left, right);
714 }
715 
716 /// @}
717 
718 #endif
GLint first
Definition: glcorearb.h:405
constexpr size_t size(const OIIO::span< T, E > &c)
Definition: span.h:380
constexpr span< ElementType, Extent > make_span(span< ElementType, Extent > s) noexcept
Definition: UT_Span.h:559
TCB_SPAN_CONSTEXPR11 span(pointer ptr, size_type count)
Definition: UT_Span.h:346
typename std::remove_pointer< T >::type remove_pointer_t
Definition: UT_Span.h:285
*get result *(waiting if necessary)*A common idiom is to fire a bunch of sub tasks at the and then *wait for them to all complete We provide a helper class
Definition: thread.h:623
static constexpr std::size_t size
Definition: UT_Span.h:188
void
Definition: png.h:1083
GLint left
Definition: glcorearb.h:2005
TCB_SPAN_CONSTEXPR11 reference back() const
Definition: UT_Span.h:509
constexpr bool UTdeepEqual(const SPANL &left, const SPANR &right)
Definition: UT_Span.h:704
GLsizei const GLfloat * value
Definition: glcorearb.h:824
span< byte,((Extent==dynamic_extent)?dynamic_extent:sizeof(ElementType)*Extent)> as_writable_bytes(span< ElementType, Extent > s) noexcept
Definition: UT_Span.h:611
constexpr span_storage() noexcept=default
GLdouble right
Definition: glad.h:2817
Definition: span.h:73
constexpr pointer data() const noexcept
Definition: UT_Span.h:515
GLdouble s
Definition: glad.h:3009
constexpr span_storage(E *p_ptr, std::size_t) noexcept
Definition: UT_Span.h:183
TCB_SPAN_NODISCARD constexpr bool empty() const noexcept
Definition: UT_Span.h:491
const element_type * const_pointer
Definition: UT_Span.h:331
IMATH_HOSTDEVICE constexpr bool equal(T1 a, T2 b, T3 t) IMATH_NOEXCEPT
Definition: ImathFun.h:105
typename std::remove_cv< ElementType >::type value_type
Definition: UT_Span.h:327
constexpr const E * data(std::initializer_list< E > il) noexcept
Definition: UT_Span.h:240
span< const byte,((Extent==dynamic_extent)?dynamic_extent:sizeof(ElementType)*Extent)> as_bytes(span< ElementType, Extent > s) noexcept
Definition: UT_Span.h:601
uint64 value_type
Definition: GA_PrimCompat.h:29
std::ptrdiff_t difference_type
Definition: UT_Span.h:329
static constexpr size_type extent
Definition: UT_Span.h:337
TCB_SPAN_CONSTEXPR11 span< element_type, Count > last() const
Definition: UT_Span.h:438
TCB_SPAN_CONSTEXPR11 span< element_type, dynamic_extent > last(size_type count) const
Definition: UT_Span.h:468
constexpr size_type size() const noexcept
Definition: UT_Span.h:484
TCB_SPAN_ARRAY_CONSTEXPR reverse_iterator rbegin() const noexcept
Definition: UT_Span.h:522
GLintptr offset
Definition: glcorearb.h:665
TCB_SPAN_ARRAY_CONSTEXPR span(const std::array< T, N > &arr) noexcept
Definition: UT_Span.h:385
constexpr auto data(C &c) -> decltype(c.data())
Definition: UT_Span.h:222
constexpr iterator begin() const noexcept
Definition: UT_Span.h:518
TCB_SPAN_INLINE_VAR constexpr std::size_t dynamic_extent
Definition: UT_Span.h:172
constexpr iterator end() const noexcept
Definition: UT_Span.h:520
TCB_SPAN_ARRAY_CONSTEXPR span(std::array< T, N > &arr) noexcept
Definition: UT_Span.h:375
#define TCB_SPAN_INLINE_VAR
Definition: UT_Span.h:115
#define TCB_SPAN_CONSTEXPR11
Definition: UT_Span.h:137
#define TCB_SPAN_ARRAY_CONSTEXPR
Definition: UT_Span.h:157
#define TCB_SPAN_NODISCARD
Definition: UT_Span.h:169
constexpr span(const span< OtherElementType, OtherExtent > &other) noexcept
Definition: UT_Span.h:420
void void_t
Definition: core.h:1512
element_type * pointer
Definition: UT_Span.h:330
typename std::remove_cv< typename std::remove_reference< T >::type >::type uncvref_t
Definition: UT_Span.h:255
#define TCB_SPAN_CONSTEXPR_ASSIGN
Definition: UT_Span.h:133
constexpr size_type size_bytes() const noexcept
Definition: UT_Span.h:486
constexpr span(element_type(&arr)[N]) noexcept
Definition: UT_Span.h:366
constexpr bool UTshallowEqual(const SPANL &left, const SPANR &right)
Definition: UT_Span.h:711
GLsizeiptr size
Definition: glcorearb.h:664
TCB_SPAN_CONSTEXPR11 reference front() const
Definition: UT_Span.h:503
TCB_SPAN_ARRAY_CONSTEXPR reverse_iterator rend() const noexcept
Definition: UT_Span.h:527
TCB_SPAN_CONSTEXPR11 span< element_type, dynamic_extent > subspan(size_type offset, size_type count=dynamic_extent) const
Definition: UT_Span.h:475
TCB_SPAN_CONSTEXPR11 subspan_return_t< Offset, Count > subspan() const
Definition: UT_Span.h:452
TCB_SPAN_CONSTEXPR11 span< element_type, dynamic_extent > first(size_type count) const
Definition: UT_Span.h:461
element_type & reference
Definition: UT_Span.h:332
auto ptr(T p) -> const void *
Definition: format.h:2448
~span() noexcept=default
GA_API const UT_StringHolder N
constexpr auto size(const C &c) -> decltype(c.size())
Definition: UT_Span.h:210
constexpr span_storage(E *p_ptr, std::size_t p_size) noexcept
Definition: UT_Span.h:195
#define TCB_SPAN_EXPECT(cond)
Definition: UT_Span.h:109
Definition: core.h:1131
constexpr span() noexcept
Definition: UT_Span.h:343
constexpr span(Container &cont)
Definition: UT_Span.h:396
constexpr span(const Container &cont)
Definition: UT_Span.h:407
TCB_SPAN_CONSTEXPR11 reference operator[](size_type idx) const
Definition: UT_Span.h:497
TCB_SPAN_CONSTEXPR11 span(pointer first_elem, pointer last_elem)
Definition: UT_Span.h:352
type
Definition: core.h:1059
std::reverse_iterator< iterator > reverse_iterator
Definition: UT_Span.h:335
constexpr bool operator()(const SPANL &left, const SPANR &right) const
Definition: UT_Span.h:694
constexpr bool operator()(const SPANL &left, const SPANR &right) const
Definition: UT_Span.h:677
GLint GLsizei count
Definition: glcorearb.h:405
Definition: format.h:895
#define TCB_SPAN_NAMESPACE_NAME
Definition: UT_Span.h:18
const element_type & const_reference
Definition: UT_Span.h:333
unsigned char byte
Definition: UT_Span.h:163