Skip to content

Pass points by value#307

Merged
simonlindholm merged 1 commit into
kth-competitive-programming:mainfrom
Matistjati:segdest
Jun 23, 2026
Merged

Pass points by value#307
simonlindholm merged 1 commit into
kth-competitive-programming:mainfrom
Matistjati:segdest

Conversation

@Matistjati

@Matistjati Matistjati commented Jan 3, 2026

Copy link
Copy Markdown
Contributor

In geometry, it's mixed whether points are passed as P&, const P& or P. We should probably be consistent. Personally, I prefer just P. We should never have P&: then you can't do reasonable things such as:

auto eval = [&](double p) {
    return segDist(a, b, c + delta * p);
};

@Matistjati

Copy link
Copy Markdown
Contributor Author

We probably shouldn't merge this yet. I haven't tested these changes, and there might be more changes to make. But I want to get the discussion going @simonlindholm

@simonlindholm

Copy link
Copy Markdown
Member

Sounds like a good idea to me.

@Matistjati Matistjati marked this pull request as ready for review June 23, 2026 11:11
@simonlindholm simonlindholm merged commit 93471f9 into kth-competitive-programming:main Jun 23, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants