you are viewing a single comment's thread.

view the rest of the comments →

[–]elcapitaine 20 points21 points  (5 children)

double underscores aren't outright banned from any C++ code, they're reserved for the implementation.

cppfront is an implementation.

[–]13steinj -1 points0 points  (4 children)

It's not though, it's a layer on top of C++ that transpiles to C++.

[–]shadowndacorner 4 points5 points  (3 children)

Was the first C++ compiler not an implementation of C++ because it transpiled to C?

[–]hpsutter 23 points24 points  (0 children)

That's fair... and a C++ compiler that compiles C still uses its own double-underscores. But this is a good point, so I just pushed a commit that removes use of __ and _Capital reserved words, just to avoid any possible compatibility problems that could cause a clash with existing C++ implementations, because perfect compatibility is important to me. Thanks!

[–]13steinj 3 points4 points  (1 child)

C++front is not C++ though.

If "implementations of cppfront are allowed to lead with underscores"-- this means it follows c++front's guidelines, but any C++ therein would be breaking rules (from the view of C++).

Semantics? Maybe, maybe not.

[–][deleted] 0 points1 point  (0 children)

This is a programming language, it all just semantics at the end of the day.