r/cpp • u/vormestrand • May 05 '18
CPY (Pre)Compiler: C++ without redundancy
https://github.com/vrsperanza/CPY#cpy7
u/jonesmz May 05 '18
You know, while I think this project is going in the absolute wrong direction, I could see the benefit of doing something like
Makes all variables that are not prefixed with the "mut" or "mutable" keyword "const"
Keeps noobs from screwing themselves.
1
4
0
May 05 '18
[deleted]
3
u/redditsoaddicting May 06 '18
I'd prefer a non-preprocessor feature that solves the problem this is solving.
1
u/pfultz2 May 06 '18
Why can't you use template aliases?
template<class X, class Y> using SomeThing = Wrapped<X, Y, mixin>;2
May 06 '18
In this case it would work, I just wanted to make it trivial.
What if I wanted to swap template to function params?
Also, I'd like to do usual "magic" in the pre-processor as of regular function parameters, like concats and "stringify".
29
u/gracicot May 05 '18
walks away slowly