compiler : visual c++ 2010
os : win7 64bits

std::string temp = "temp";	
boost::tuple<std::string> A( std::move(temp) );	//this is copy
std::tuple<std::string> A( std::move(temp) ); //better, woundn't compile

this is inconvenient when I want to do something like this

std::tuple<std::string> kkk()
{
  std::string temp = "temp";
  return std::make_tuple( std::move(temp) );
}

This can't work either(as expected)

std::unique_ptr<std::string> strMove(new std::string("jjjjj"));	
boost::tuple< std::unique_ptr<std::string> > move_tuple( std::move(strMove) );

This one is okay

std::shared_ptr<std::string> strShared(new std::string("wawawa"));
boost::tuple< std::shared_ptr<std::string> > move_tuple( strShared );

Do C++11 make tuple assist rvalue reference?
Thanks

Edited 5 Years Ago by stereomatching: n/a

I just test it on gcc4.6.2
looks like the tuple of gcc4.6.2 support rvalue reference but visual c++ do not
I hope that visual c++ could support variadic template and
support rvalue reference better ASAP

The absence of variadic templates is the fundamental problem with Microsoft C++. It surfaces in several different places posing as different problems.

This is (in effect) what the IS says:

template< typename... TYPES > tuple<TYPES...> std::make_tuple( TYPES&&... args ) ;

returns std::tuple<TYPES...>( std::forward<TYPES...>(args...) ) ;

with std::reference_wrapper<T> unwrapped to T&

Microsoft does not have variadic templates, so they implemented it using a bunch of preprocessor macros and in the process replaced the r-value references with l-value references to const.
http://msdn.microsoft.com/en-us/library/bb982346.aspx

This article has been dead for over six months. Start a new discussion instead.