My Project
integer_sequence.hpp
Go to the documentation of this file.
1 
28 #ifndef BSL_INTEGER_SEQUENCE_HPP
29 #define BSL_INTEGER_SEQUENCE_HPP
30 
31 #include "details/integer_sequence_max.hpp"
32 #include "details/integer_sequence_min.hpp"
33 
34 #include "cstdint.hpp"
35 
36 namespace bsl
37 {
51  template<typename T, T... INTS>
52  class integer_sequence final
53  {
54  public:
56  using value_type = T;
57 
65  [[nodiscard]] static constexpr bsl::uintmax
66  size() noexcept
67  {
68  return sizeof...(INTS);
69  }
70 
78  [[nodiscard]] static constexpr T
79  max() noexcept
80  {
81  return details::integer_sequence_max<T, INTS...>::value;
82  }
83 
91  [[nodiscard]] static constexpr T
92  min() noexcept
93  {
94  return details::integer_sequence_min<T, INTS...>::value;
95  }
96  };
97 
99  template<bsl::uintmax... INTS>
101 
103  template<typename T, T N>
104  using make_integer_sequence = __make_integer_seq<integer_sequence, T, N>;
105 
107  template<bsl::uintmax N>
109 
111  template<typename... T>
113 }
114 
115 #endif
make_index_sequence< sizeof...(T)> index_sequence_for
helper alias that makes an index sequence given a list of types
Definition: integer_sequence.hpp:112
__make_integer_seq< integer_sequence, T, N > make_integer_sequence
helper alias that makes integer sequences
Definition: integer_sequence.hpp:104
The class template std::integer_sequence represents a compile-time sequence of integers....
Definition: integer_sequence.hpp:52
T value_type
provides the member typedef "value_type"
Definition: integer_sequence.hpp:56
make_integer_sequence< bsl::uintmax, N > make_index_sequence
helper alias that makes integer sequences for bsl::uintmax
Definition: integer_sequence.hpp:108
static constexpr bsl::uintmax size() noexcept
Equivalent to sizeof...(INTS)
Definition: integer_sequence.hpp:66
static constexpr T min() noexcept
Returns the min integer in the sequence.
Definition: integer_sequence.hpp:92
static constexpr T max() noexcept
Returns the max integer in the sequence.
Definition: integer_sequence.hpp:79
::uintmax_t uintmax
defines a unsigned integer with the maximum possible size
Definition: cstdint.hpp:97