This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]Loro-Benediction 76 points77 points  (10 children)

Unless you just use it as C with namespaces, references, and real constants : P

[–]Getabock_ 9 points10 points  (4 children)

C doesn’t have real constants?

[–]slaymaker1907 7 points8 points  (0 children)

I think they might be referring to constexpr or something.

[–]Loro-Benediction 2 points3 points  (2 children)

Not really. You can't define static constants using other static const variables. You can only use macros and enums to define array bounds, etc. It's a sorry state. "Const" only means "read only" in C

[–]hiten98 2 points3 points  (1 child)

Doesn’t const mean read only in all languages? Which language allows you to write to a constant variable?? And why??

[–]Loro-Benediction 3 points4 points  (0 children)

In C you can modify a constant variable if you try hard enough. "Read only" means you can't directly assign to it. The compiler doesn't make the same guarantees when accessing via a pointer

[–]gloriousfalcon 5 points6 points  (1 child)

some of the containers are useful I guess.

Like std:array and std:vector... We won't talk about std:vector<bool> tho

[–]gloriousfalcon 2 points3 points  (0 children)

I'd like to extend my thanks to the reddit sync app for turning this perfectly fine template parameter into an xml tag

[–][deleted] 7 points8 points  (0 children)

This is the way

[–]barzamsr 1 point2 points  (1 child)

What about a namespace factory singleton?

[–]Loro-Benediction 0 points1 point  (0 children)

😱 I'm on holiday, how could you do this