Instantly share code, notes, and snippets.

Embed
What would you like to do?
std::vector< std::pair<const std::string&, btVector3> > PhysicsSystem::doPhysics (float duration, MWWorld::World& world,
const std::vector<std::pair<std::string, Ogre::Vector3> >& actors)
{
...
std::vector< std::pair<const std::string&, btVector3> > response;
for(std::map<std::string,OEngine::Physic::PhysicActor*>::iterator it = mEngine->PhysicActorMap.begin(); it != mEngine->PhysicActorMap.end();it++)
{
/*OEngine::Physic::PhysicActor* act = it->second;
btVector3 newPos = act->getPosition();
MWWorld::Ptr ptr = world.getPtrViaHandle (it->first);
world.moveObject (ptr, newPos.x(), newPos.y(), newPos.z());*/
std::pair<const std::string&, btVector3> x(it->first, it->second->getPosition());
response.push_back(x);
}
return response;
}
build ->
In file included from /usr/include/c++/4.5/bits/stl_algobase.h:66:0,
from /usr/include/c++/4.5/vector:61,
from /home/sebastian/prog/OpenMW/openmw/apps/openmw/mwworld/physicssystem.hpp:4,
from /home/sebastian/prog/OpenMW/openmw/apps/openmw/mwworld/physicssystem.cpp:1:
/usr/include/c++/4.5/bits/stl_pair.h: In member function ‘std::pair<const std::basic_string<char>&, btVector3>& std::pair<const std::basic_string<char>&, btVector3>::operator=(const std::pair<const std::basic_string<char>&, btVector3>&)’:
/usr/include/c++/4.5/bits/stl_pair.h:72:5: instantiated from ‘void std::vector<_Tp, _Alloc>::_M_insert_aux(std::vector<_Tp, _Alloc>::iterator, const _Tp&) [with _Tp = std::pair<const std::basic_string<char>&, btVector3>, _Alloc = std::allocator<std::pair<const std::basic_string<char>&, btVector3> >, std::vector<_Tp, _Alloc>::iterator = __gnu_cxx::__normal_iterator<std::pair<const std::basic_string<char>&, btVector3>*, std::vector<std::pair<const std::basic_string<char>&, btVector3> > >, typename std::_Vector_base<_Tp, _Alloc>::_Tp_alloc_type::pointer = std::pair<const std::basic_string<char>&, btVector3>*]’
/usr/include/c++/4.5/bits/stl_vector.h:749:4: instantiated from ‘void std::vector<_Tp, _Alloc>::push_back(const value_type&) [with _Tp = std::pair<const std::basic_string<char>&, btVector3>, _Alloc = std::allocator<std::pair<const std::basic_string<char>&, btVector3> >, value_type = std::pair<const std::basic_string<char>&, btVector3>]’
/home/sebastian/prog/OpenMW/openmw/apps/openmw/mwworld/physicssystem.cpp:82:33: instantiated from here
/usr/include/c++/4.5/bits/stl_pair.h:72:5: error: non-static reference member ‘const std::basic_string<char>& std::pair<const std::basic_string<char>&, btVector3>::first’, can't use default assignment operator
In file included from /usr/include/c++/4.5/vector:69:0,
from /home/sebastian/prog/OpenMW/openmw/apps/openmw/mwworld/physicssystem.hpp:4,
from /home/sebastian/prog/OpenMW/openmw/apps/openmw/mwworld/physicssystem.cpp:1:
/usr/include/c++/4.5/bits/vector.tcc: In member function ‘void std::vector<_Tp, _Alloc>::_M_insert_aux(std::vector<_Tp, _Alloc>::iterator, const _Tp&) [with _Tp = std::pair<const std::basic_string<char>&, btVector3>, _Alloc = std::allocator<std::pair<const std::basic_string<char>&, btVector3> >, std::vector<_Tp, _Alloc>::iterator = __gnu_cxx::__normal_iterator<std::pair<const std::basic_string<char>&, btVector3>*, std::vector<std::pair<const std::basic_string<char>&, btVector3> > >, typename std::_Vector_base<_Tp, _Alloc>::_Tp_alloc_type::pointer = std::pair<const std::basic_string<char>&, btVector3>*]’:
/usr/include/c++/4.5/bits/vector.tcc:312:4: note: synthesized method ‘std::pair<const std::basic_string<char>&, btVector3>& std::pair<const std::basic_string<char>&, btVector3>::operator=(const std::pair<const std::basic_string<char>&, btVector3>&)’ first required here
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment