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

feat: allow template specialization #598

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

JohelEGP
Copy link
Contributor

@JohelEGP JohelEGP commented Aug 17, 2023

Resolves #467.
Partially addresses #387 (#387 (comment)).

@JohelEGP

This comment was marked as resolved.

@JohelEGP

This comment was marked as resolved.

Copy link
Contributor

@MaxSagebaum MaxSagebaum left a comment

Choose a reason for hiding this comment

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

LGTM, but I have doubts about the choice of the type keyword.

I had problems with the newest version of gcc.

regression-tests/pure2-template-specialization.cpp2 Outdated Show resolved Hide resolved
source/parse.h Outdated Show resolved Hide resolved
@JohelEGP JohelEGP force-pushed the template_specialization branch from 0f4436c to eb04fb1 Compare September 14, 2023 00:39
@JohelEGP JohelEGP changed the title feat: recognize template specialization feat: allow template specialization Sep 14, 2023
@JohelEGP JohelEGP force-pushed the template_specialization branch from eb04fb1 to 3aa3929 Compare September 22, 2023 18:38
@JohelEGP JohelEGP force-pushed the template_specialization branch from 3aa3929 to 16174b3 Compare October 3, 2023 19:15
@JohelEGP JohelEGP force-pushed the template_specialization branch from 16174b3 to dc850fa Compare October 31, 2023 17:08
@JohelEGP JohelEGP force-pushed the template_specialization branch from 7dd5d76 to 955a8ec Compare November 9, 2023 21:43
@JohelEGP JohelEGP force-pushed the template_specialization branch from e01a933 to d7cc82a Compare December 11, 2023 15:23
@JohelEGP JohelEGP force-pushed the template_specialization branch from 3d0c7a2 to 3bfd904 Compare December 23, 2023 16:02
@JohelEGP JohelEGP force-pushed the template_specialization branch from 3bfd904 to 12ad062 Compare October 2, 2024 12:06
The syntax is `specialize<specialization_arguments>`
after the optional template parameter list.

Some examples from the tests:
```Cpp2
std: namespace = {
    common_type: @struct @print specialize<outer, outer> type = {
        type: type == outer;
    }
}
v: <T> const i32 = 1;
v: <> specialize<void> const i32 = 2;
v: specialize<i64> const i32 = 3;
v: <T> specialize<* T> std::optional<int> == 6;
```
@JohelEGP JohelEGP force-pushed the template_specialization branch from b8dc740 to 32d1ebd Compare October 9, 2024 16:46
@hsutter
Copy link
Owner

hsutter commented Oct 31, 2024

Hi! Sorry it took me so long to get to this one... but this looks like it might still be current.

Is this up to date, and would you like me to review it?

@hsutter hsutter added the question - further information requested Further information is requested label Oct 31, 2024
@JohelEGP
Copy link
Contributor Author

Yes, and yes, please do.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question - further information requested Further information is requested
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] Add support for defining template specializations.
3 participants