Variable declaration by calling its constructor

71 Views Asked by At

In some Boost ASIO example, I found the line auto self(shared_from_this());. self doesn't seem to be declared anywhere and doesn't seem to be a reserved keyword. In another example, I also found the use of auto self = shared_from_this();, which seems to be somehow equivalent. Why can I call something that is not declared before? And why does it somehow work as a variable declaration?

0

There are 0 best solutions below