abbra: (Default)
[personal profile] abbra
Не хотите больше быть программистом? Оставьте свой след в истории:
http://blog.8thlight.com/dariusz-pasciak/2012/07/03/dereferencing-null-pointer-without-a-seg-fault.html

После того, как прочитали, заходите под кат и ответьте на вопрос: Скажите, а вас учили, что оператор -> над классами в C++ эквивалентен разыменованию указателя в C?

Что интересно, в стандарте С++ в 5.2.5 (Class member access) в третьем абзаце написано:
If E1 has the type “pointer to class X,” then the expression E1->E2 is converted to the equivalent form (*(E1)).E2; the remainder of 5.2.5 will address only the first option (dot).

Правда, 13.5.6 (Class member access) говорит уже более аккуратно об этом:
An expression x->m is interpreted as (x.operator->())->m for a class object x of type T if T::operator->() exists and if the operator is selected as the best match function by the overload resolution mechanism (13.3)

This account has disabled anonymous posting.
If you don't have an account you can create one now.
HTML doesn't work in the subject.
More info about formatting

If you are unable to use this captcha for any reason, please contact us by email at support@dreamwidth.org

April 2016

S M T W T F S
     12
3456789
1011121314 1516
17181920212223
24252627282930

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Page generated Jul. 11th, 2025 10:54 pm
Powered by Dreamwidth Studios