8000 Consider changing UnitTest::Check signature to take value by const reference. · Issue #7 · unittest-cpp/unittest-cpp · GitHub
[go: up one dir, main page]

Skip to content

Consider changing UnitTest::Check signature to take value by const reference. #7

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

Closed
pjohnmeyer opened this issue Jan 17, 2013 · 0 comments
Assignees
Milestone

Comments

@pjohnmeyer
Copy link
Member

From https://sourceforge.net/tracker/?func=detail&aid=2604261&group_id=158151&atid=806684

As of v.1.4, UnitTest::Check() takes a value by copy, however, due to copy constructors, calling this function can have side effects. I feel it is preferable to pass the value by reference, e.g.

template <typename Value>
Check (Value const& value) {
return !!value;
}

This appears to be an inconsistency with the changes from r178 on sourceforge.

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
0