digitalmars.D - d > rust
I brought up this code block in a meta-programming discord
```d
template staticCurry(alias F,Args...){
template staticCurry(S...){
auto staticCurry(T...)(T t)=>F!(Args,S)(t);
}}
```
apparently its very very hard in c++ and impossible for rust to
replicate; feel free to use it in any future arguments
Jun 23
On Wednesday, 24 June 2026 at 02:36:12 UTC, monkyyy wrote:
I brought up this code block in a meta-programming discord
```d
template staticCurry(alias F,Args...){
template staticCurry(S...){
auto staticCurry(T...)(T t)=>F!(Args,S)(t);
}}
```
apparently its very very hard in c++ and impossible for rust to
replicate; feel free to use it in any future arguments
Thank you. Don't forget the Zig people!
Jun 23
On Wednesday, 24 June 2026 at 02:36:12 UTC, monkyyy wrote:apparently its very very hard in c++ and impossible for rust to replicate; feel free to use it in any future argumentsGPT suggested for C++: ```cpp template <template<class...> class F, class... Args> struct static_curry { template<class... S> struct apply { template<class T> auto operator()(T&& t) { return F<Args..., S...>{}(std::forward<T>(t)); } }; }; ``` For Nim: ```nim template staticCurry(F: untyped, args: varargs[untyped]): untyped = template inner(s: varargs[untyped]): untyped = proc call[T](t: T) = F(args, s, t) ``` For Haskell: ```haskell type StaticCurry f args s = f args s ``` For Zig: ```zig fn staticCurry(comptime F: anytype, comptime Args: anytype) type { return struct { pub fn apply(comptime S: anytype, t: anytype) void { F(Args, S, t); } }; } ``` Don't know if any from above will work :)
Jun 23
On Wednesday, 24 June 2026 at 06:41:54 UTC, Serg Gini wrote:... GPT suggested for C++: ...It might work but it's ugly hmm... =] Matheus.
Jun 24









Kapendev <alexandroskapretsos gmail.com> 