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

Add ostream operator template for std::vectors #1116

Merged
merged 6 commits into from Jun 4, 2019

Conversation

terhorstd
Copy link
Contributor

Streaming std::vectors just streams all elements (given that the elements support cout << obj;). This is very useful in many circumstances and should not be implemented each time anew.

@jougs jougs self-requested a review February 18, 2019 11:10
@jougs
Copy link
Contributor

jougs commented Feb 18, 2019

@terhorstd: you can either fix the format of the code you're proposing or start another PR to change the formatting guidelines as discussed two weeks ago and to make your code pass the tests. Both options would be fine for me at this point in time.

@terhorstd terhorstd added T: Enhancement New functionality, model or documentation ZC: Kernel DO NOT USE THIS LABEL ZP: PR Created DO NOT USE THIS LABEL S: Normal Handle this with default priority I: No breaking change Previously written code will work as before, no one should note anything changing (aside the fix) labels Mar 8, 2019
@heplesser heplesser self-requested a review March 13, 2019 07:35
Copy link
Contributor

@heplesser heplesser left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@terhorstd Good idea, but see my comments in the code. In contrast to @jougs, I'd ask you to format the code according to our current guidelines.

nestkernel/streamers.h Outdated Show resolved Hide resolved
nestkernel/streamers.h Outdated Show resolved Hide resolved
nestkernel/streamers.h Outdated Show resolved Hide resolved
@terhorstd terhorstd requested a review from heplesser April 9, 2019 14:33
Copy link
Contributor

@jougs jougs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

{
os << ", ";
}
os << element;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@terhorstd Don't you need to set first to false somewhere?

@heplesser heplesser changed the title added ostream operator template for std::vectors Add ostream operator template for std::vectors Jun 4, 2019
@heplesser heplesser merged commit e57dd0a into nest:master Jun 4, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
I: No breaking change Previously written code will work as before, no one should note anything changing (aside the fix) S: Normal Handle this with default priority T: Enhancement New functionality, model or documentation ZC: Kernel DO NOT USE THIS LABEL ZP: PR Created DO NOT USE THIS LABEL
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants