News for hackers. Stuff that matters.
Re:Talking to C Programmers about C++ [video] by KayEss on Sunday September 25, 2016 @07:20AM (#12574848)
Can you give some concrete examples?
Re:Talking to C Programmers about C++ [video] by FrozenVoid on Sunday September 25, 2016 @07:47AM (#12574922)
Re:Talking to C Programmers about C++ [video] by KayEss on Sunday September 25, 2016 @09:59AM (#12575332)
Personally I think that looks pretty good. There's no templates, no inheritance. Not sure what would make bloat there nor latency. Whatever the faults of the syntax for folding, it's got to be better than VA_ARGS hasn't it?
Re:Talking to C Programmers about C++ [video] by adsofhoads on Sunday September 25, 2016 @10:22AM (#12575432)
There are templates: for example

    void print1(auto x){std::cout<< x;}
is a function template

    template <class T>
    void print1(T x){std::cout<< x;}
This is not valid C++14 however, so it doesn't compile. If you replace these, you'll probably still get a stack overflow while expanding the templates because there are almost 7000 arguments to a single function call.
Re:Talking to C Programmers about C++ [video] by FrozenVoid on Sunday September 25, 2016 @11:10AM (#12575646)
>This is not valid C++14 however, so it doesn't compile.

It is "valid C++" IF there are fewer arguments, like 6-10

The example illustrates C++ internal representation of "variadic functions".

Re:Talking to C Programmers about C++ [video] by adsofhoads on Sunday September 25, 2016 @11:28AM (#12575715)
I was referring to the use of generic functions (ie. with an argument with type-specifier auto) which is not C++14. Your copy of g++ may accept it as an extension.
Re:Talking to C Programmers about C++ [video] by KayEss on Monday September 26, 2016 @03:29AM (#12579953)
And that works if you use the old C style variadic functions?I suppose I see no reason why it wouldn't, but that isn't the same.
Re:Talking to C Programmers about C++ [video] by FrozenVoid on Sunday September 25, 2016 @10:03AM (#12575344)
Have you tried to compile and run it?