
----- Original Message ----- From: "Anthony Williams" <anthony.ajw@gmail.com> To: <boost@lists.boost.org> Sent: Friday, May 21, 2010 10:01 AM Subject: Re: [boost] [thread] Compiler eoorrs while running the tests
"vicente.botet" <vicente.botet@wanadoo.fr> writes:
----- Original Message ----- From: "Anthony Williams" <anthony.ajw@gmail.com>
Have 10.1/Darwin, vacpp/AIX and gcc 4.3.4/FreeBSD rvalue references when running on C++098 mode?
I don't know about Intel 10.1 or vacpp, but gcc 4.3.4 only has rvalue references in C++0x mode.
I don't undesrtand how this test can work with your move semantics emulation?
boost::thread make_thread_return_local(boost::thread::id* the_id) { boost::thread t(do_nothing,the_id); return t; }
It's the NRVO optimization --- the named object is constructed directly in the return value rather than copied. Many compilers do the optimization, but they are supposed to check for an accessible copy constructor anyway.
The compilers it works on must skip the required check for an accessible copy constructor, so they are not strictly conforming to C++98, but in this case it's a bonus. In C++0x this is also required to work if the object being returned has an accessible move constructor.
Well, as the behaviour is not conforming to C++98, I would say that the test must be part of compile-fails for C++98 compilers, and state that in these compiler the test fails as expected. Of course the test must succeed on C++0x as boost::thread defines a constructor from a rvalue reference. Any other opinions? Vicente