Комментарии:
Thanks a lot for this great talk
ОтветитьOne of the best cppcons imho, thank u 4 posting this
ОтветитьGreat talk! So much to learn, not just from the topics covered but also the clarity in delivery. Just like to chime in for slide 13: isn't top-level const also not considered in overload resolution? (Although this is touched on by a question from the audience later on)
ОтветитьAs soon as you see these two, you just know you’re going to get a very clear, very well-paced, very well-planned, and very thorough explanation of whatever the talk is about.
Always fantastic talks from these two.
It is an excellent talk. However I have used C++ maybe for 16 years totally and the following rules was enough for me:
A. Function overload precedence
1. An exact fitting, or a trivial conversion (array name in a pointer, function name in a function pointer, type T to const T).
2. Integral types promotion of numeric numbers (char int, float in double)
3. Traditional conversions (int to double, double to int), pointers to derivatives to pointers to base classes. Pointers to arbitrarily types to void pointes.
4. Conversions achieved with transformations specified by user code
5. Conversions due due to ellipsis ... (c style varargs)
If at the same level, two options are possible then call is considered controversial and rejected with compiler error.
B. Template function overloading searches for a set of suitable specializations according to steps below
1. All specializations that can be potentially called are searched
2. If any specialization is the more specialized of the two, then the less specialized is discarded.
3. Overloading set is functions from step 1-2 and regular functions from (A)
4. Regular function is considered as more prevalent if both template and non-template function considered as a good candidate
If the function passed 1-4 is not found, the call is incorrect and lead to ambiguity.
C. Binary operator overload resolution rules x@y. Where x is of type X and y is of type Y
1. If X is a class. Find out whether operator@ is a member of class X or base to class X
2. Try find operator operator@ in context of x@y
3. If X is namespace N, search for operator in namespace N
4. If Y is namespace M, search for operator in namespace M
That all information wa enough for me for all my experience. I have learned about after I have read - The C ++ Programming Language Special Edition, B.Stroustrup
damn that's enough of c++ for me today
ОтветитьAs it is usual for this team, here is another clear and perfect presentation.
Ответитьnice talk. Overload resolution is mind bending quiz. no one can answer exact answer, its in the hands of compiler, even if you read C++ std. many... times.
ОтветитьI hope they fix Ansel's audio because this video is gonna really stand the test of time. Superb and useful, and explained in a way that anyone at pretty much any skill level can understand it!
ОтветитьWho’s life would be better if c++ authors knew how to keep a language clean and easy to read and write? ….. everyonessss
ОтветитьWow! thanks for the talk! Never thought an hour long video on overload resolution can be this interesting! I had found some of these examples online but never had a good understanding of rankings! I was already a huge fan of Ansel and Barbara's videos on their channel, impressive stuff again!
ОтветитьGreat Talk!Thank you
Ответить