Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove std::shared_ptr from class Stop? #209

Open
matdahl opened this issue May 30, 2022 · 0 comments
Open

Remove std::shared_ptr from class Stop? #209

matdahl opened this issue May 30, 2022 · 0 comments
Labels
cython/C++ cython/c++ related

Comments

@matdahl
Copy link
Collaborator

matdahl commented May 30, 2022

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.

@fxjung fxjung changed the title Remove std::shared_ptr from class Stop ? Remove std::shared_ptr from class Stop? Jan 30, 2024
@fxjung fxjung added the cython/C++ cython/c++ related label Sep 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cython/C++ cython/c++ related
Projects
None yet
Development

No branches or pull requests

2 participants