C++ Logo

std-proposals

Advanced search

[std-proposals] Alternative Free Function Calling Syntax.

From: Bad At The Game <inheritanceiskey_at_[hidden]>
Date: Sun, 28 Sep 2025 17:13:12 +0200
Hi, I tried to take another approach at UFCS, Here

https://github.com/ZXShady/proposals/blob/main/alternative_free_function_call_syntax.md

It isn't professionally written I tried my best.

I like free functions but I don't like them syntax wise, I prefer left to
right reading in most cases than inside out and sometimes left to right at
same time.

```cpp
    auto collisions = getCollisionBoxes(expanded(translated(aabb,
position), vel), dimension, block_registry);
```

this is hard to read but I don't want to have intermediary variables that
have no meaningful names.

While with that proposal it would allow
```cpp
auto collisions = aabb.
                      .math::translated(position)
                      .math::expanded(vel)
             .gameLogic::getCollisionBoxes(dimension, block_registry);
```

Received on 2025-09-28 15:13:14