Hi,
Thanks for answering me.
I change the code to be:
1 2 3 4 5 6 7
|
void Busline::get_tr_stops(vector <Visit_stop*> visit_transfers)
{
for(size_t i=0; i<transfer_stops.size(); ++i)
{
visit_transfers.emplace_back(transfer_stops[i] , 0.0);
}
}
|
But I got errors:
C:\Program Files (x86)\Microsoft Visual Studio 12\VC\include\xmemory0(617): error C2440: 'initializing' : cannot convert from 'double' to 'std::pair<_Ty1,_Ty2> '
1> with
1> [
1> _Ty1=Busstop *,
1> _Ty2=double
1> ]
1> C:\Program Files (x86)\Microsoft Visual Studio 12\VC\include\xmemory0(751) : see reference to function template instantiation 'void std::allocator<_Ty>::construct<_Objty,Busstop*&,double>(_Objty *,_V0_t,_V1_t &&)' being compiled
1> with
1> [
1> _Ty=std::pair<Busstop *,double> *,
1> _Objty=std::pair<Busstop *,double> *,
1> _V0_t=Busstop *&,
1> _V1_t=double
1> ]
1> C:\Program Files (x86)\Microsoft Visual Studio 12\VC\include\xmemory0(751) : see reference to function template instantiation 'void std::allocator<_Ty>::construct<_Objty,Busstop*&,double>(_Objty *,_V0_t,_V1_t &&)' being compiled
1> with
1> [
1> _Ty=std::pair<Busstop *,double> *,
1> _Objty=std::pair<Busstop *,double> *,
1> _V0_t=Busstop *&,
1> _V1_t=double
1> ]
Sorry for making careless mistakes in the code, because I am new in C++
Thanks a lot,