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

Remove node_stack Peek templating where possible #4801

Merged
merged 1 commit into from
Jan 15, 2025

Conversation

jonmeow
Copy link
Contributor

@jonmeow jonmeow commented Jan 15, 2025

The "templated for consistency" variants felt a little confusing when I was working on #4795, so suggesting to remove templating where it's not helpful to instantiate (particularly when there were both templated and non-templated variants). Note this leaves a PeekIs<IdT> because there's indirection there, but that's more the exception than the rule.

Copy link
Contributor

@zygoloid zygoloid left a comment

Choose a reason for hiding this comment

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

Yeah, I suppose it's inconsistent regardless -- we have some calls that pass a type and so must use a template argument, and some calls that pass a runtime value and so cannot use a template argument. Given that the inconsistency is unavoidable, I guess it's better to use a runtime argument wherever possible.

@zygoloid zygoloid added this pull request to the merge queue Jan 15, 2025
Merged via the queue into carbon-language:trunk with commit f726948 Jan 15, 2025
10 checks passed
@jonmeow jonmeow deleted the peek-template branch January 16, 2025 23:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants