Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Sepples "scoped/class enum" Retardation

Name: Anonymous 2019-01-04 9:45

https://smartbear.com/blog/develop/closer-to-perfection-get-to-know-c11-scoped-and-ba/
https://en.cppreference.com/w/cpp/language/enum
So uh, basically instead of BronzeColor
we use Color::Bronze and when we have to assign to int we use static_cast(while C doesn't need anything and typing is easier).

Name: Anonymous 2019-01-04 10:51

The underlying problem is the usage of code-polluting paamayim nekudotayim instead of the ..

Name: Anonymous 2019-01-04 13:52

C: enum bepis { sweet, sour };
void f(enum anus, ...);

this is valid: f(sour);
And if you also have enum candy { sweet }; you will get an error
Thanks C!

Name: Anonymous 2019-01-05 5:17

>>3
The solution was right in the article
CategoryNameEnumValue, no need to use same
identifier and being retarded.

Name: Anonymous 2019-01-05 8:53

Artificial problem. When do you actually use same identifier for two enums?

Name: Anonymous 2019-01-05 10:15

>>4
f(sour)

Name: Anonymous 2019-01-05 10:48

>>6
Do you think you're clever? Fuck all the way off.

Name: Anonymous 2019-01-05 14:06

This is an extremely useful feature that prevents bugs.
it's too much typing
You mean you don't have autocomplete? In 2019?

Name: Anonymous 2019-01-06 10:19

C:
enum Color {BronzeColor,SilverColor,GoldColor};

enum Bullion{SilverBullion,GoldBullion,PlatinumBullion};
Color col1=BronzeColor;
if ((col2==SilverColor) || (col2==GoldColor))
int carcolor=SilverColor;

C++:
enum class Color //C++11 scoped enum
{Bronze,Silver,Gold};

enum struct Bullion //C++11 scoped enum
{Silver, Gold,Platinum };
Color col1=Color::Bronze;
if ((col2==Color::Silver) || (col2==Color::Gold))
int carcolor=static_cast<int>(Color::Silver);

Name: Anonymous 2019-01-06 15:27

Fuck unicode

Name: Anonymous 2019-01-06 20:01

>>7
More so than you, yes.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List