您的位置:首页 > 其它

vs2010使用boost::interpocess编译出错

2010-10-15 20:17 429 查看
需要修改

#if defined(BOOST_MOVE_DOXYGEN_INVOKED)
//! This function provides a way to convert a reference into a rvalue reference
//! in compilers with rvalue reference. For other compilers converts T & into
//! <i>::boost::interprocess::rv<T> &</i> so that move emulation is activated.
template <class T> inline
rvalue_reference move (input_reference);
#else
//template <class T> inline
//typename remove_reference<T>::type&& move(T&& t)
//{  return t;   }
template <class T> inline
typename remove_reference<T>::type&& move(T&& t)
{  return t;   }
#endif


对return t;做一个强制转换

#if defined(BOOST_MOVE_DOXYGEN_INVOKED)
//! This function provides a way to convert a reference into a rvalue reference
//! in compilers with rvalue reference. For other compilers converts T & into
//! <i>::boost::interprocess::rv<T> &</i> so that move emulation is activated.
template <class T> inline
rvalue_reference move (input_reference);
#else
//template <class T> inline
//typename remove_reference<T>::type&& move(T&& t)
//{  return t;   }
template <class T> inline
typename remove_reference<T>::type&& move(T&& t)
{  return static_cast<remove_reference<T>::type&&>(t);   }
#endif
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: