m_meshes is a std::vector< boost::shared_ptr<const Mesh> > in the code
below, and Mesh is constructible from a const std::string&
BOOST_FOREACH( const std::string& fileName, meshFiles )
{
m_meshes.push_back( boost::make_shared<Mesh>(fileName) );
}
Using make_shared here gives me the following error, while explicitly
constructing a shared_ptr does not. Mesh isn't defined with
__declspec(align('16')), but I believe it owns a member that is. Am I
doing something wrong or is this a known limitation of make_shared?
Also, I am using MSVC9 if that wasn't obvious.
1>C:\Work\redshirt\third_party\boost\1_42_0\boost/smart_ptr/detail/sp_counted_impl.hpp(138)
: error C2719: 'd': formal parameter with __declspec(align('16')) won't
be aligned
1>
C:\Work\redshirt\third_party\boost\1_42_0\boost/smart_ptr/detail/shared_count.hpp(124)
: see reference to class template instantiation
'boost::detail::sp_counted_impl_pd
' being compiled
1> with
1> [
1> P=rs::Mesh *,
1> D=boost::detail::sp_ms_deleterrs::Mesh
1> ]
1>
C:\Work\redshirt\third_party\boost\1_42_0\boost/smart_ptr/shared_ptr.hpp(199)
: see reference to function template instantiation
'boost::detail::shared_count::shared_count(P,D)' being compiled
1> with
1> [
1> Y=rs::Mesh,
1> D=boost::detail::sp_ms_deleterrs::Mesh,
1> P=rs::Mesh *
1> ]
1>
C:\Work\redshirt\third_party\boost\1_42_0\boost/smart_ptr/make_shared.hpp(181)
: see reference to function template instantiation
'boost::shared_ptr<T>::shared_ptr(Y
*,D)' being compiled
1> with
1> [
1> T=rs::Mesh,
1> Y=rs::Mesh,
1> D=boost::detail::sp_ms_deleterrs::Mesh
1> ]
1> C:\Work\redshirt\components\rs/renderer/Model.hpp(46) : see
reference to function template instantiation 'boost::shared_ptr<T>
boost::make_sharedrs::Mesh,std::string(const A1 &)' being compiled
1> with
1> [
1> T=rs::Mesh,
1> A1=std::string
1> ]
1>
C:\Work\redshirt\third_party\boost\1_42_0\boost/serialization/access.hpp(101)
: see reference to function template instantiation 'void
rs::Model::load<Archive>(Archive &,const unsigned int)' being compiled
1> with
1> [
1> Archive=boost::archive::xml_iarchive
1> ]
1>
C:\Work\redshirt\third_party\boost\1_42_0\boost/serialization/split_member.hpp(54)
: see reference to function template instantiation 'void
boost::serialization::access::member_load(Archive &,T &,const
unsigned int)' being compiled
1> with
1> [
1> Archive=boost::archive::xml_iarchive,
1> T=rs::Model
1> ]
1>
C:\Work\redshirt\third_party\boost\1_42_0\boost/serialization/split_member.hpp(53)
: while compiling class template member function 'void
boost::serialization::detail::member_loader::invoke(Archive
&,T &,const unsigned int)'
1> with
1> [
1> Archive=boost::archive::xml_iarchive,
1> T=rs::Model
1> ]
1>
C:\Work\redshirt\third_party\boost\1_42_0\boost/serialization/split_member.hpp(69)
: see reference to class template instantiation
'boost::serialization::detail::member_loader' being compiled
1> with
1> [
1> Archive=boost::archive::xml_iarchive,
1> T=rs::Model
1> ]
1> C:\Work\redshirt\components\rs/renderer/Model.hpp(50) : see
reference to function template instantiation 'void
boost::serialization::split_member(Archive &,T
&,const unsigned int)' being compiled
1> with
1> [
1> Archive=boost::archive::xml_iarchive,
1> T=rs::Model
1> ]
1>
C:\Work\redshirt\third_party\boost\1_42_0\boost/serialization/access.hpp(118)
: see reference to function template instantiation 'void
rs::Model::serialize<Archive>(Archive &,const unsigned int)' being compiled
1> with
1> [
1> Archive=boost::archive::xml_iarchive
1> ]
1>
C:\Work\redshirt\third_party\boost\1_42_0\boost/serialization/serialization.hpp(74)
: see reference to function template instantiation 'void
boost::serialization::access::serialize(Archive &,T &,const
unsigned int)' being compiled
1> with
1> [
1> Archive=boost::archive::xml_iarchive,
1> T=rs::Model
1> ]
1>
C:\Work\redshirt\third_party\boost\1_42_0\boost/serialization/serialization.hpp(133)
: see reference to function template instantiation 'void
boost::serialization::serialize(Archive &,T &,const unsigned
int)' being compiled
1> with
1> [
1> Archive=boost::archive::xml_iarchive,
1> T=rs::Model
1> ]
1>
C:\Work\redshirt\third_party\boost\1_42_0\boost/archive/detail/iserializer.hpp(186)
: see reference to function template instantiation 'void
boost::serialization::serialize_adl(Archive &,T &,const
unsigned int)' being compiled
1> with
1> [
1> Archive=boost::archive::xml_iarchive,
1> T=rs::Model
1> ]
1>
C:\Work\redshirt\third_party\boost\1_42_0\boost/archive/detail/iserializer.hpp(170)
: while compiling class template member function 'void
boost::archive::detail::iserializer::load_object_data(boost::archive::detail::basic_iarchive
&,void *,const unsigned int) const'
1> with
1> [
1> Archive=boost::archive::xml_iarchive,
1> T=rs::Model
1> ]
1>
C:\Work\redshirt\third_party\boost\1_42_0\boost/archive/detail/iserializer.hpp(386)
: see reference to class template instantiation
'boost::archive::detail::iserializer' being compiled
1> with
1> [
1> Archive=boost::archive::xml_iarchive,
1> T=rs::Model
1> ]
1>
C:\Work\redshirt\third_party\boost\1_42_0\boost/archive/detail/iserializer.hpp(433)
: see reference to function template instantiation 'void
boost::archive::detail::load_non_pointer_type<Archive>::load_standard::invoke<T>(Archive
&,const T &)' being compiled
1> with
1> [
1> Archive=boost::archive::xml_iarchive,
1> T=rs::Model
1> ]
1>
C:\Work\redshirt\third_party\boost\1_42_0\boost/archive/detail/iserializer.hpp(580)
: see reference to function template instantiation 'void
boost::archive::detail::load_non_pointer_type<Archive>::invoke<T>(Archive
&,T &)' being compiled
1> with
1> [
1> Archive=boost::archive::xml_iarchive,
1> T=rs::Model
1> ]
1>
C:\Work\redshirt\third_party\boost\1_42_0\boost/archive/detail/common_iarchive.hpp(68)
: see reference to function template instantiation 'void
boost::archive::load(Archive &,T &)' being compiled
1> with
1> [
1> Archive=boost::archive::xml_iarchive,
1> T=rs::Model
1> ]
1>
C:\Work\redshirt\third_party\boost\1_42_0\boost/archive/basic_xml_iarchive.hpp(86)
: see reference to function template instantiation 'void
boost::archive::detail::common_iarchive<Archive>::load_override<T>(T
&,int)' being compiled
1> with
1> [
1> Archive=boost::archive::xml_iarchive,
1> T=rs::Model
1> ]
1>
C:\Work\redshirt\third_party\boost\1_42_0\boost/archive/xml_iarchive.hpp(80)
: see reference to function template instantiation 'void
boost::archive::basic_xml_iarchive<Archive>::load_overriders::Model(const
boost::serialization::nvp<T> &,int)' being compiled
1> with
1> [
1> Archive=boost::archive::xml_iarchive,
1> T=rs::Model
1> ]
1>
C:\Work\redshirt\third_party\boost\1_42_0\boost/archive/detail/interface_iarchive.hpp(61)
: see reference to function template instantiation 'void
boost::archive::xml_iarchive_impl<Archive>::load_override<T>(T &,int)'
being compiled
1> with
1> [
1> Archive=boost::archive::xml_iarchive,
1> T=const boost::serialization::nvprs::Model
1> ]
1> ..\..\..\..\components\libs\renderer\source\Model.cpp(20) :
see reference to function template instantiation 'Archive
&boost::archive::detail::interface_iarchive<Archive>::operator >>(const boost::serialization::nvp<T> &)'
being compiled
1> with
1> [
1> Archive=boost::archive::xml_iarchive,
1> T=rs::Model
1> ]