• Create Account

### #ActualL. Spiro

Posted 22 October 2012 - 09:07 PM

Hmmm... I've been clicking on the little code icon on the text editing toolbar (bottom row, farthest to the right -- to the right of the indent and alignment buttons). Is that not the right thing to be using?

To the left of the Quote icon is an icon that looks like “<>”. Use this.

I don't have to fully qualify other things, like my class/struct member methods, and I don't believe I've ever had this problem with free functions. What's the difference?

They were implicitly qualified by being inside “namespace ATCFramework { }”.

You have a class inside the ATCFramework namespace and declare an operator for it.
Inside the .CPP you start with “ATCFramework {” at the top, put all the class definitions next, and at the end you put “}”.
If those classes have operators it is not necessary to do this:

bool ATCFramework::MyClass::operator == ( etc. ) {
}

The ATCFramework:: part is implicit.

However your Point class is nested inside another class.
If you are still inside the “namespace ATCFramework { }” area you still don’t need to add the “ATCFramework::”, but you do need to add both classes:
bool MyClass::Point::operator == ( etc. ) {
}

L. Spiro

### #1L. Spiro

Posted 22 October 2012 - 09:06 PM

Hmmm... I've been clicking on the little code icon on the text editing toolbar (bottom row, farthest to the right -- to the right of the indent and alignment buttons). Is that not the right thing to be using?

To the left of the Quote icon is an icon that looks like “<>”. Use this.

I don't have to fully qualify other things, like my class/struct member methods, and I don't believe I've ever had this problem with free functions. What's the difference?

They were implicitly qualified, by being inside “namespace ATCFramework { }”.

You have a class inside the ATCFramework namespace and declare an operator for it.
Inside the .CPP you start with “ATCFramework {” at the top, put all the class definitions next, and at the end you put “}”.
If those classes have operators it is not necessary to do this:

bool ATCFramework::MyClass::operator == ( etc. ) {
}

The ATCFramework:: part is implicit.

However your Point class is nested inside another class.
If you are still inside the “namespace ATCFramework { }” area you still don’t need to add the “ATCFramework::”, but you do need to add both classes:
bool MyClass::Point::operator == ( etc. ) {
}

L. Spiro

PARTNERS