3 ms·
It seems a lot of cpy features are covered by C++ and/or libraries. For deduced types you can do auto a = 10; auto b = a; And not have to mess with k
by RcouF1uZ4gsC 9y ago
It seems a lot of cpy features are covered by C++ and/or libraries.
For deduced types you can do
auto a = 10;
auto b = a;
And not have to mess with known.
For multiple return types you can do structured binding and make_tuple.
auto [a,b] = func();
Where func is
auto func(){return std::make_tuple(1.5, 3);}
Using a loop, you can use boost::irange
for(auto i: irange(0,10)){
For the output stuff, you can use fmt (https://github.com/fmtlib/fmt/blob/master/README.rst https://github.com/fmtlib/fmt/blob/master/README.rst) which is on track for standardization.
fmt::print("{} {} {} ", a,b,c);
Overall most of the problems that CPY implies have pretty good solutions in C++ without the pain of another pre-processor
- ktpsns 9y agoThis is very true. It would be elegant if "CPY" compiled to these newer C++ features (or boost).
- vrsperanza 9y agoThat is exactly what it does