HemoGoblin
HemoGoblin

Reputation: 155

Do nested structs affect performance?

If the nested struct will contain only static constant members, will it affect performance anyhow? I want to use it to scope these constants.

class File {

    public:

        struct Mode {
            static const int Read = 0x01, Write = 0x02, Append = 0x04;
        };

};

Is this a good practice?

Upvotes: 0

Views: 553

Answers (1)

Luchian Grigore
Luchian Grigore

Reputation: 258568

Not at all, the variables are resolved at compile-time, not run-time.

Upvotes: 3

Related Questions