I saw the following binary operator specified in the book p. 191 ,
Point-to-member selection x->*y
I understand x->y , but not x->*y . Is it a typo or something else?
x->y
x->*y
Something else. See C ++ Frequently Asked Questions:
http://www.parashift.com/c++-faq-lite/pointers-to-members.html
y is a pointer to a member type inside type *x , see the example below.
y
*x
struct Obj { int m; };
...
Obj o; Obj * p = &o; int Obj::* y = &Obj::m; // 'y' can point to any int inside Obj, currently it pointing at Obj::m // do notice that it not bound to any specific instance of Obj om = 10; std::cout << (p->* y) << std::endl; std::cout << (o .* y) << std::endl;
Output
10 10
Source: https://habr.com/ru/post/1386368/More articles:Run GUI from another class? - javastrtotime with variable in wordpress - variablesjava 1.6 enum issue com.ibm.ws.webservices.engine.enum.Style.WRAPPED - javaJW Player: stop JW Player on the last frame - jwplayerWhat does T mean in this class signature and how can I create this class? - c #Why does the REGEXP_LIKE function treat the letter "e" as uppercase instead of a lowercase letter? - sqlInternal representation of objects - c ++Attempt to save username / password in cookie; JQuery - javascriptRemoving elements from a multidimensional array in Java - javaSort by filter fields and ranking of text matching in sphinx - sphinxAll Articles