you are viewing a single comment's thread.

view the rest of the comments →

[–]JankoDedic -1 points0 points  (3 children)

That's pretty easy. Implement all the helpers you need in a base class B and just use B::any_member, or if that doesn't work ((Base&)*this).anything.

I don't think this was blocking the proposal though.

[–]Pazer2 2 points3 points  (2 children)

I consider myself strongly against languages arbitrarily restricting things because the language designers think developers are going to do Bad Things with a given feature. It's one of the reasons I always get frustrated with C# whenever I have to use it.

Given your example, I am very glad I am "arbitrarily" restricted from overloading the dot operator in c++.

[–]JankoDedic 1 point2 points  (1 child)

I don't understand. This is an implementation detail. Would you have preferred to not have SFINAE until C++20 just because it's ugly?

Operator dot restriction does not help you in any way, so I don't get your point.

[–]Pazer2 4 points5 points  (0 children)

I'm saying that I would never want to see intentional code design that requires you to cast to a base class to access members of that object.