py::builtins::operator ->* (py::builtins::range) (specialization)

Defined in <pypp/builtins/range.hpp>

template <class type>
bool operator ->* (const type& element, const in<range<type>>& range);

Returns whether a range contains a value.

Template parameters

type: Type of the value to find.

Parameters

value: The value to find.

range: An py::builtins::in object referencing range.

Return value

Whether the range contains a value.

Complexity

Constant.

Example

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

int main()
{
    py::range<int> nums(6);
    py::print(4 ->* py::in(nums));
}

Output:

true