I'm trying to implement a string function in C++, so it can operate as in Python.
For example, in Python you can code like,
str = "filename.ext"
bits_0 = str[1:3]
bits_1 = str[-1:]
: is not an operator in C++. It's only part of the scope resolution operator
:: or the ternary operator
?:. Since it's not an operator, it can't be overloaded.
Editorial note: if you want to use Python, use Python.