7

I'm reading boost documentation and see the following at http://www.boost.org/doc/libs/1_54_0/doc/html/lambda/le_in_details.html :

Operators that cannot be overloaded

Some operators cannot be overloaded at all (::, ., .*). For some operators, the requirements on return types prevent them to be overloaded to create lambda functors. These operators are ->., ->, new, new[], delete, delete[] and ?: (the conditional operator).

So what is the operator ->. ? I tried Google and http://www.symbolhound.com/ but didn't get anything useful, searching on N3337 gives 1 result that is -> at the end of a sentence, and Visual Studio 2012 won't compile:

class xT {
    bool operator ->. () {} /* fail */
};

std::string* p;
p->.size(); /* fail */

std::auto_ptr<std::string> a;
a->.size(); /* fail */

I believe the author intentionally wrote ->. since -> and . is also included, but what is ->., or why it is here?

Community
  • 1
  • 1
jingyu9575
  • 521
  • 3
  • 16

3 Answers3

7

IT seems to be a typo.

In the C++ draft 3690, there is no mention about an operator ->..

It could be the ->*:

5.5 Pointer-to-member operators [expr.mptr.oper]

The pointer-to-member operators ->* and .* group left-to-right.

And in http://www.boost.org/doc/libs/1_54_0/doc/html/lambda/le_in_details.html, they have some example with this operator.

Community
  • 1
  • 1
Pierre Fourgeaud
  • 14,290
  • 1
  • 38
  • 62
  • Well... `.*` is also here but I didn't think about it... My mind was filled with something that calls user-defined `operator ->` and get member from the non-pointer result – jingyu9575 Sep 20 '13 at 08:37
3

As you can see from C++11, 2.13: "Operators and punctuators", there is no such operator as "->.".

Kerrek SB
  • 464,522
  • 92
  • 875
  • 1,084
0

There is no such operator like "->." http://msdn.microsoft.com/en-us/library/x04xhy0h.aspx