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

Empty vector as parameters (should be simplified) #3314

Open
fgalan opened this issue Sep 27, 2018 · 0 comments
Open

Empty vector as parameters (should be simplified) #3314

fgalan opened this issue Sep 27, 2018 · 0 comments

Comments

@fgalan
Copy link
Member

fgalan commented Sep 27, 2018

Raised #3301 (comment)

We have several functions/methods that use std::vector<> as parameters. In some cases, we want to pass an empty vector so in order to fit with function signature we need to create an empty vector to be passed. This add extra complexity in the code.

Some alternatives:

  • Use NULL for these parameters. However, this may break coding style for these parameters which are read-only, as style mandates const& and NULL couldn't be used there.
  • Use a variant of the function will less parameters (which invokes in sequence the full-parameters version). We will need that empty vector, but only in one place (the function with few parameters calling the full parameters one).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant