You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is there a reason why the member request of the class template Stop is a std::shared_ptr?
As the usage would be much easier if it would be just a normal pointer, I would propose to replace this by an ordinary pointer Request<Loc> * otherwise.
Furthermore, the default constructor Stop<Loc>() currently lead to undefined behavior since estimated_arrival_time and occupancy_after_servicing are not initialized in this case and therefore contain random values when constructing a Stop this way. Is there a use case for the standard constructor of Stop?
Otherwise, it would be safer to remove it and force people to use the other constructor that requires all needed parameters.
The text was updated successfully, but these errors were encountered:
fxjung
changed the title
Remove std::shared_ptr from class Stop ?
Remove std::shared_ptr from class Stop?
Jan 30, 2024
Is there a reason why the member
request
of the class templateStop
is astd::shared_ptr
?As the usage would be much easier if it would be just a normal pointer, I would propose to replace this by an ordinary pointer
Request<Loc> *
otherwise.Furthermore, the default constructor
Stop<Loc>()
currently lead to undefined behavior sinceestimated_arrival_time
andoccupancy_after_servicing
are not initialized in this case and therefore contain random values when constructing aStop
this way. Is there a use case for the standard constructor ofStop
?Otherwise, it would be safer to remove it and force people to use the other constructor that requires all needed parameters.
The text was updated successfully, but these errors were encountered: