Why does this say shaddowing? If I change my member X and Y to _X, _Y
then when I access my class via the dot operator, it shows FOUR values..
Current Class:
class Point
{
public:
int X, Y;
Point(int X, int Y);
~Point();
};
Point::Point(int X, int Y) : X(X), Y(Y) {}
Previous class that shows x, y, X, Y:
class Point
{
public:
int Y, Y;
Point(int x, int y);
~Point();
};
Point::Point(int x, int y) : X(x), Y(y) {}
How can I stop the compiler from telling me it's shaddowing but at the same time only have the class members show in my intellisense instead of both class and function members?
Codeblocks and VS2010 and VS2012 RC do this :S
Also why should I include <complex>
to use std::abs instead of including math.h and using fabs?
I'm trying to compare floating point values using:
#define VERYSMALL (1.0E-150)
#define EPSILON (1.0E-8)
bool Extended::Equal(double a, double b)
{
double absDiff = std::abs(a - b);
if (absDiff < VERYSMALL)
return true;
double maxAbs = max(std::abs(a), std::abs(b));
return (absDiff/maxAbs) < EPSILON;
}