What I want to do is --> create a new object in a new thread. Something like:
Class* object = 0;
Arg arg;
boost::thread t( lambda::bind( object = lambda::new_ptr< Class >()( boost::ref( arg ) );
it doesn't compile, what's correct way?
What I want to do is --> create a new object in a new thread. Something like:
Class* object = 0;
Arg arg;
boost::thread t( lambda::bind( object = lambda::new_ptr< Class >()( boost::ref( arg ) );
it doesn't compile, what's correct way?
Copyright © 2021 Jogjafile Inc.
Thanks to ildjarn, I tried with boost::phoenix and got it work, code is:
Again, from ildjarn, the better code is:
Class* object = 0;
CArg arg0;
Arg arg1;
namespace phx = boost::phoenix;
boost::thread t( phx::ref( object ) = phx::new_< Class >( phx::cref( arg0 ), phx::ref( arg1 ) );