Christian M. says it's bad to chain one constructor call from another.
I can't find anything that addresses this in Stroustrup, but I also don't see them doing this in any of their examples. So I have rewritten this instance to use default arguments to accomplish the same thing. I imagine there are other instances of this same sort of thing in other classes to be fixed at a later date.
This commit is contained in:
parent
c600aad7a7
commit
2b12425a62
@ -38,11 +38,6 @@ SGWayPoint::SGWayPoint( const double lon, const double lat, const double alt,
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
SGWayPoint::SGWayPoint() {
|
|
||||||
SGWayPoint( 0.0, 0.0, 0.0, WGS84, "" );
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// Destructor
|
// Destructor
|
||||||
SGWayPoint::~SGWayPoint() {
|
SGWayPoint::~SGWayPoint() {
|
||||||
}
|
}
|
||||||
|
@ -79,9 +79,6 @@ private:
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
/** Default constructor */
|
|
||||||
SGWayPoint();
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Construct a waypoint
|
* Construct a waypoint
|
||||||
* @param lon destination longitude
|
* @param lon destination longitude
|
||||||
@ -90,8 +87,9 @@ public:
|
|||||||
* @param mode type of coordinates/math to use
|
* @param mode type of coordinates/math to use
|
||||||
* @param s waypoint identifier
|
* @param s waypoint identifier
|
||||||
*/
|
*/
|
||||||
SGWayPoint( const double lon, const double lat, const double alt,
|
SGWayPoint( const double lon = 0.0, const double lat = 0.0,
|
||||||
const modetype m = WGS84, const string s = "" );
|
const double alt = 0.0, const modetype m = WGS84,
|
||||||
|
const string s = "" );
|
||||||
|
|
||||||
/** Destructor */
|
/** Destructor */
|
||||||
~SGWayPoint();
|
~SGWayPoint();
|
||||||
|
Loading…
Reference in New Issue
Block a user