When an object is indexed using operator [], the overloaded function called depends on the type of the object being indexed. The sequence of calling overloaded functions for the operator [] is as follows:
If the object being indexed is an array or a pointer, the overloaded subscript operator [] specific to that data type is called.
If the object being indexed is a class object that has overloaded the subscript operator [], then that overloaded operator is called.
If the object being indexed is a class object and the overloaded subscript operator [] is not defined for that class, the compiler looks for a member function named operator[] within the class hierarchy.
If the operator [] is not defined for the object being indexed nor within the class hierarchy, a compiler error is generated.
Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss
Asked: 2021-08-28 11:00:00 +0000
Seen: 10 times
Last updated: Aug 01 '21
When executing Firestore functions, why does the process not terminate?
How are the functions indexOf and findIndex of an array different from each other?
How can modules/packages be installed for AWS Lambda functions that can run on different platforms?
What does it mean to transfer the docstring of one function to another function with the same name?
At what point in time are the call operators for lambda functions created?
What is the process of setting up AWS Cloudfront and associating lambda functions?