py::builtins::range::size

constexpr std::size_t size() const;

Returns the count of values hold by the range.

Return value

The count of values hold by the range.

Complexity

Constant.

Example

#include <pypp/builtins/range.hpp>
#include <pypp/builtins/print.hpp>

int main()
{
    py::print(py::range<int>(1, 8).size());
}

Output:

7