1
私はboost :: ptr_vector :: pop_front()戻り値の型は何ですか?
...戻り値の型auto_type
がしかし、:: auto_ptrはにはstd後押し:: shared_ptrのをするために割り当てるこの
typedef ptr_container_detail::static_move_ptr<Ty_,Deleter> auto_type;
ように定義され、失敗したauto_type boost::ptr_vector::pop_front()
を使用して少し問題があります
Error 1 error C2440: 'initializing' : cannot convert from 'boost::ptr_container_detail::static_move_ptr<T,Deleter>' to 'std::auto_ptr<_Ty>'
Error 1 error C2440: 'initializing' : cannot convert from 'boost::ptr_container_detail::static_move_ptr<T,Deleter>' to 'std::tr1::shared_ptr<_Ty>'
Error 1 error C2440: 'initializing' : cannot convert from 'boost::ptr_container_detail::static_move_ptr<T,Deleter>' to 'std::tr1::weak_ptr<_Ty>'
実装を見てみると、pop_front
のように見えるので、フロントにスマートポインタを返してその値を返す必要があります。
auto_type pop_front()
{
BOOST_ASSERT(!this->empty() &&
"'pop_front()' on empty container");
auto_type ptr(static_cast<value_type>(this->base().front()));
// nothrow
this->base().pop_front(); // nothrow
return ptr_container_detail::move(ptr);
}
しかし、どのタイプがauto_type
ですか?