Large boost::multi_array Problem

Hi,
I have the following problem, I make a boost::multi_array

I think boost::thread will beneficiate from a third constructor:
thread::thread( boost::shared_ptr< boost::function0<void>& > )
1. This constructor will allow to use functors that are heavy to copy or simply non - copiable.
2. This contructor will also allow polymorphic functors. For example, in the following code, the copying of the functor destroys its polymorphism (there is not any 2 printed in the output) :
#include

Calderon Hector wrote:
I think boost::thread will beneficiate from a third constructor:
thread::thread( boost::shared_ptr< boost::function0<void>& > )
1. This constructor will allow to use functors that are heavy to copy or simply non - copiable.
2. This contructor will also allow polymorphic functors. For example, in the following code, the copying of the functor destroys its polymorphism (there is not any 2 printed in the output) :
#include
#include <iostream> class A { public: unsigned int m_a;
A( unsigned int a_a ) : m_a( a_a ) {}
void Begin() {boost::thread ( * this );}
void operator ()() {foo(); std::cout << m_a;}
virtual void foo() {m_a = 3; std::cout << m_a;} };
Drop operator() and use boost::bind( &A::foo, shared_ptr<A>( new B ) ) as a thread proc.

Drop operator() and use boost::bind( &A::foo, shared_ptr( new B ) ) as a thread proc.
Thank you, it worked perfectly. ++Hector C. ---------------------------------- --------------------------------- Blab-away for as little as 1¢/min. Make PC-to-Phone Calls using Yahoo! Messenger with Voice.

Calderon Hector
I think boost::thread will beneficiate from a third constructor:
See http://www.boost.org/more/discussion_policy.htm#effective -- Dave Abrahams Boost Consulting www.boost-consulting.com
participants (4)
-
Adam Hartshorne
-
Calderon Hector
-
David Abrahams
-
Peter Dimov