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

Handle operators 2 #448

Merged
merged 3 commits into from Jul 10, 2019

Conversation

Projects
None yet
4 participants
@rpavlik
Copy link
Contributor

commented Jul 9, 2019

Alternate to #447 - doesn't have the operator bool stuff, but you at least get ==, !=, and <. Let's see what CI thinks.

@whitequark

This comment has been minimized.

Copy link
Member

commented Jul 9, 2019

@jwesthues Any strong opinions on this change? It adds a bit of type safety in that it's an error to compare unrelated handles, and it makes maps with handles as keys a bit nicer. And although I'm very much not fond of the way C++ manages to provide basic functionality, this implementation is not invasive and shouldn't cause us any problems like doing this with CRTP.

Overall, a lot of people cite SolveSpace's idiosyncratic C++ as a reason the codebase is hard to contribute to; and although some of those complaints are not that well founded, some others are. I personally think there's no especially good reason to not define equality on aggregate classes where it makes sense for all members.

@whitequark whitequark referenced this pull request Jul 9, 2019

Closed

Handle operators #447

@jwesthues

This comment has been minimized.

Copy link
Member

commented Jul 10, 2019

Seems reasonable to me.

@whitequark whitequark merged commit b2af9ce into solvespace:master Jul 10, 2019

3 checks passed

continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
license/cla Contributor License Agreement is signed.
Details
@whitequark

This comment has been minimized.

Copy link
Member

commented Jul 10, 2019

Thanks @rpavlik!

@phkahler

This comment has been minimized.

Copy link
Contributor

commented Jul 10, 2019

Yes, thanks @rpavlik. I like the readability improvements this brings.

@rpavlik rpavlik deleted the rpavlik:handle-operators-2 branch Jul 11, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.