|
|
|
@ -4,6 +4,7 @@ void TestParameterProperties(bool a, const short& b, int* c = nullptr) {}; |
|
|
|
// Tests various AST helper methods (like FindClass, FindOperator etc.)
|
|
|
|
// Tests various AST helper methods (like FindClass, FindOperator etc.)
|
|
|
|
namespace Math |
|
|
|
namespace Math |
|
|
|
{ |
|
|
|
{ |
|
|
|
|
|
|
|
// Tests FindClass("Math::Complex")
|
|
|
|
struct Complex { |
|
|
|
struct Complex { |
|
|
|
Complex(double r, double i) : re(r), im(i) {} |
|
|
|
Complex(double r, double i) : re(r), im(i) {} |
|
|
|
Complex operator+(Complex &other); |
|
|
|
Complex operator+(Complex &other); |
|
|
|
@ -11,7 +12,10 @@ namespace Math |
|
|
|
double re, im; |
|
|
|
double re, im; |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
// Operator overloaded using a member function
|
|
|
|
// Tests FindTypedef("Math::Single")
|
|
|
|
|
|
|
|
typedef float Single; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Tests FindOperator method
|
|
|
|
Complex Complex::operator+(Complex &other) { |
|
|
|
Complex Complex::operator+(Complex &other) { |
|
|
|
return Complex(re + other.re, im + other.im); |
|
|
|
return Complex(re + other.re, im + other.im); |
|
|
|
} |
|
|
|
} |
|
|
|
|