opDispatch() and opBinaryRight()

Now, let’s talk about opDispatch() and opBinaryRight() functions.

Catch-all operator opDispatch()

opDispatch gets called whenever a missing member of an object is accessed. All attempts to access non-existent members are dispatched to this function.

The name of the missing member becomes the template parameter value of opDispatch.

The following code demonstrates a simple definition:

Get hands-on with 1200+ tech skills courses.