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

Support dependent operator templates #222

Merged
merged 1 commit into from
Aug 9, 2023

Conversation

elbeno
Copy link
Contributor

@elbeno elbeno commented Aug 6, 2023

This change allows operators (not just fields/member functions) as dependent template expressions.

auto x = y.template operator()<int>();

This syntax is used e.g. to call C++20 lambda expressions with a template head where the template arguments are not function arguments and therefore cannot be deduced.

[]<typename> () {}.template operator()<int>();

@amaanq
Copy link
Member

amaanq commented Aug 9, 2023

rebase please

This change allows operators (not just fields/member functions) as dependent
template expressions.

```cpp
auto x = y.template operator()<int>();
```

This syntax is used e.g. to call C++20 lambda expressions with a template head
where the template arguments are not function arguments and therefore cannot be
deduced.

```cpp
[]<typename> () {}.template operator()<int>();
```
@amaanq amaanq merged commit 869f1be into tree-sitter:master Aug 9, 2023
4 checks passed
@amaanq
Copy link
Member

amaanq commented Aug 9, 2023

Thanks for the PRs!

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