62 this->stop = (start == -1) ? std::numeric_limits<int>::max() : start + 1;
72 template <
typename Start,
typename Stop>
73 requires(std::same_as<Start, slicing::none_t> ||
74 std::convertible_to<Start, int>) &&
75 (std::same_as<Stop, slicing::none_t> ||
76 std::convertible_to<Stop, int>)
87 template <
typename Start,
typename Stop,
typename Step>
88 requires(std::same_as<Start, slicing::none_t> ||
89 std::convertible_to<Start, int>) &&
90 (std::same_as<Stop, slicing::none_t> ||
91 std::convertible_to<Stop, int>) &&
92 (std::same_as<Step, slicing::none_t> ||
93 std::convertible_to<Step, int>)
95 if constexpr (std::same_as<Step, slicing::none_t>) {
98 slp_assert(step != 0);
104 if (this->step == std::numeric_limits<int>::min()) {
105 this->step = -std::numeric_limits<int>::max();
108 if constexpr (std::same_as<Start, slicing::none_t>) {
109 if (this->step < 0) {
110 this->start = std::numeric_limits<int>::max();
118 if constexpr (std::same_as<Stop, slicing::none_t>) {
119 if (this->step < 0) {
120 this->stop = std::numeric_limits<int>::min();
122 this->stop = std::numeric_limits<int>::max();
137 slp_assert(step != 0);
138 slp_assert(step >= -std::numeric_limits<int>::max());
144 start = (step < 0) ? -1 : 0;
146 }
else if (start >=
length) {
154 stop = (step < 0) ? -1 : 0;
156 }
else if (stop >=
length) {
162 return (start - stop - 1) / -step + 1;
168 return (stop - start - 1) / step + 1;