1974 shaares
6 private links
6 private links
1 result
tagged
operator
In languages such as python, there is an in operator that is used to check if element is in a range:
if 5 in [1, 2, 3, 4, 5]: print("There is a 5")
What’s nice about this, is the almost english type readability of it. Let’s look at how we can implement such an operator in C++14.
Named operator made easy:
https://github.com/klmr/named-operator