$include_dir="/home/hyper-archives/boost/include"; include("$include_dir/msg-header.inc") ?>
Subject: Re: [boost] VC10 config - some regressions in several libraries
From: John Maddock (boost.regex_at_[hidden])
Date: 2010-04-26 12:05:41
> It seems that my problem with move emulation in projects imported from 
> older MSVC to MSVC10 is that some rvalue references rules need language 
> extensions option activated. Otherwise we can't have movable-only types.
It seems some explicit casts are required, for example in 
boost/interprocess/detail/move.hpp:
template <class T> inline
typename remove_reference<T>::type&& move(T&& t)
{  return t;   }
Should be either:
template <class T> inline
typename remove_reference<T>::type&& move(T&& t)
{  return std::move(t);   }
or
template <class T> inline
typename remove_reference<T>::type&& move(T&& t)
{  return static_cast<typename remove_reference<T>::type&&>(t);   }
Likewise for the "forward" function.
However that still leaves errors deep within the Boost.Preprocessor code:
1>  adaptive_node_pool_test.cpp
1>m:\data\boost\trunk\boost\preprocessor\iteration\detail\local.hpp(37): 
error C2664: 'boost::interprocess::forward' : cannot convert parameter 1 
from 
'boost::interprocess::segment_manager<CharType,MemoryAlgorithm,IndexType> ' 
to 'boost::interprocess::segment_manager<CharType,MemoryAlgorithm,IndexType> 
*&&'
1>          with
1>          [
1>              CharType=char,
1> 
MemoryAlgorithm=boost::interprocess::rbtree_best_fit<boost::interprocess::mutex_family>,
1>              IndexType=boost::interprocess::iset_index
1>          ]
1>          You cannot bind an lvalue to an rvalue reference
1> 
m:\data\boost\trunk\libs\interprocess\test\node_pool_test.hpp(146) : see 
reference to function template instantiation 'T 
*boost::interprocess::detail::named_proxy<SegmentManager,T,is_iterator>::operator 
()<boost::interprocess::segment_manager<CharType,MemoryAlgorithm,IndexType>*>(P0 
&&) const' being compiled
1>          with
1>          [
1>              T=node_pool_t,
1> 
SegmentManager=boost::interprocess::segment_manager<char,boost::interprocess::rbtree_best_fit<boost::interprocess::mutex_family>,boost::interprocess::iset_index>,
1>              is_iterator=false,
1>              CharType=char,
1> 
MemoryAlgorithm=boost::interprocess::rbtree_best_fit<boost::interprocess::mutex_family>,
1>              IndexType=boost::interprocess::iset_index,
1> 
P0=boost::interprocess::segment_manager<char,boost::interprocess::rbtree_best_fit<boost::interprocess::mutex_family>,boost::interprocess::iset_index> 
*
1>          ]
1> 
m:\data\boost\trunk\libs\interprocess\test\adaptive_node_pool_test.cpp(24) : 
see reference to function template instantiation 'bool 
boost::interprocess::test::test_all_node_pool<node_pool_t>(void)' being 
compiled
Which appear to have the same cause, but I'm unable to figure out what needs 
changing.
Seems likely that gcc in C++0x mode has the same issues - creating an rvalue 
ref needs an explicit cast.
HTH, John.