c++ - passing allocated pointer before it allocated -


I am studying open source project ROS when I saw strange code

  Server server (n, "do_dishes", boost :: bind (and executed, _1, and server), incorrect);   

The variable server is used before assigning it as server . Is this possible? At least, my Visual Studio 2010 Compiler does not understand that style of code. Please tell me whether this is actually a possible code or not.

The original document of the code:


--------- Added

Thanks for your kindness, however, the "server" Found: The undisclosed identifier "error when I compile it." So I tested the simple code

  class TestCls {public: TestCls (TestCls * AA) {}}; int main (int argc , Char ** argv) {TestCls TT (& amp; टीटी);}   

This also creates the same error "TT: Undeclared identifier" am I forgetting something? Please Help me.

This is legal when they are declared, then the variable is in the radius, this rule exists to create self-referenced data-structures in a row. The object can point as long as the object is not created.

Since the indicator is being passed in the server constructor, it works, Unless the server function object is colored Before doing the right forward.

Comments

Popular posts from this blog

Pass DB Connection parameters to a Kettle a.k.a PDI table Input step dynamically from Excel -

multithreading - PhantomJS-Node in a for Loop -

c++ - MATLAB .m file to .mex file using Matlab Compiler -