CTTG
CTTG

Reputation: 27

C++ Class that has multiple names

class Color
{
    int r;
    int g;
    int b;
};

I've created a class like above, and I would like to be able to use the same class using 'Colour' as an alternative of this class like below.

Colour c;

Would there be a way to create this simply?

Upvotes: 0

Views: 182

Answers (1)

Jarod42
Jarod42

Reputation: 217275

You might create alias:

using Colour = Color;

Upvotes: 3

Related Questions