50 this->stop = (start == -1) ? std::numeric_limits<int>::max() : start + 1;
58 template <
typename Start,
typename Stop>
59 requires(std::same_as<Start, slicing::none_t> ||
60 std::convertible_to<Start, int>) &&
61 (std::same_as<Stop, slicing::none_t> ||
62 std::convertible_to<Stop, int>)
71 template <
typename Start,
typename Stop,
typename Step>
72 requires(std::same_as<Start, slicing::none_t> ||
73 std::convertible_to<Start, int>) &&
74 (std::same_as<Stop, slicing::none_t> ||
75 std::convertible_to<Stop, int>) &&
76 (std::same_as<Step, slicing::none_t> ||
77 std::convertible_to<Step, int>)
79 if constexpr (std::same_as<Step, slicing::none_t>) {
82 slp_assert(step != 0);
88 if (this->step == std::numeric_limits<int>::min()) {
89 this->step = -std::numeric_limits<int>::max();
92 if constexpr (std::same_as<Start, slicing::none_t>) {
94 this->start = std::numeric_limits<int>::max();
102 if constexpr (std::same_as<Stop, slicing::none_t>) {
103 if (this->step < 0) {
104 this->stop = std::numeric_limits<int>::min();
106 this->stop = std::numeric_limits<int>::max();
119 slp_assert(step != 0);
120 slp_assert(step >= -std::numeric_limits<int>::max());
126 start = (step < 0) ? -1 : 0;
128 }
else if (start >=
length) {
136 stop = (step < 0) ? -1 : 0;
138 }
else if (stop >=
length) {
144 return (start - stop - 1) / -step + 1;
150 return (stop - start - 1) / step + 1;