Setting Up Your Own Rules?

Is there anything in C++ where you can set up your own rules within the language to take place before compiling the language?. For example, if i wanted to make a rule that said I don't want any variables to be changed when someone is contributing a class to my code, and if they do the compiler will be set up to throw an error at them. Or even something bizarre like, any INT variable, will be converted to a Double variable before compiling. Is any feature built like this in C++?
I don't think so

but with classes, you can do

class test
{
protected or private:
}

Anything in class if declared constant cannot be changed. There is a special syntax to insitialize them as well.
And Operator overloading allows you to work different operators as you want, e.g. you can make + operator do suptraction, etc.

Example of Operator overloading:http://libraryofcprograms.blogspot.com/2013/03/operatoroverloading.html
Topic archived. No new replies allowed.