hsutter / cppfront

A personal experimental C++ Syntax 2 -> Syntax 1 compiler
Other
5.23k stars 224 forks source link

Add `..` syntax to select a member function only #1101

Closed hsutter closed 2 weeks ago

hsutter commented 3 weeks ago

With this PR, x.f() is still UFCS, but x..f() will now find only a member function.

For now I like that the default is UFCS, but as we get more experience I'm open to changing the default so that . is member selection and .. is UFCS (which would be a breaking change, but a mechanical one).

Also: Remove the old version of get_declaration_of now that the new lookup seems stable.

jarzec commented 3 weeks ago

@hsutter It looks like builds/regression tests on some platforms fail due to warnings that become errors. Fixing the problems should not be difficult. Would you like some help with that? In any case, I would suggest merging #1095 first as it fixes some pre-existing regression test issues.

jcanizales commented 2 weeks ago

but x..f() will now find only a member function.

Hi, what is the use case this is addressing, if you don' t mind me asking?

gregmarr commented 2 weeks ago

but x..f() will now find only a member function.

Hi, what is the use case this is addressing, if you don' t mind me asking?

Quite a bit of discussion at https://github.com/hsutter/cppfront/issues/1004

jarzec commented 2 weeks ago

Is the PR ready to be merged?

hsutter commented 2 weeks ago

(deleted some comments with extraneous info)

@JarekGlobus wrote:

A relatively simple solution to running Linux on Windows without security concerns is using Docker containers. It is not difficult to set up such a solution. Docket is very popular so there is a lot of online material on using it.

I'll take a look. Thanks!