Šimon Tóth’s Post

View profile for Šimon Tóth

C++ Educational Content Creator | 20 years of Software Engineering experience distilled into digestible daily posts

When calling a member function, the name lookup can lead to surprising behaviour. Name lookup operates in steps and will stop when it encounters any match; this includes non-viable matches. The lookup always starts in the class type scope that matches the variable's static type, not the dynamic type of the object. Compiler Explorer link: https://lnkd.in/ecPKR4M2 #cpp #cplusplus #coding #programming #dailybiteofcpp

  • text
SEBASTIEN LEVY

m374-crypt0880 followers

2y

Wow first time I see this syntax in MixinB: `this auto &self`. I can't find something talking about this in en.cppreference.com so far. Is it to specify a member method owned by any type in the inheritance hierarchy? I'm gonna look for the way it could be re-written when not using template deduction stuff...

Like
Reply
graham walsh

Toptal968 followers

2y

You should have put a few virtual functions in there for completeness BTW

Like
Reply

I read through all this crap not to get surprised. Is this a troll post, or did I just miss the point?

Like
Reply
graham walsh

Toptal968 followers

2y

But not a bad post 👍

Like
Reply
See more comments

To view or add a comment, sign in

Explore content categories