improve coherency between UniformVariable and RandomVariable, explain why the extra overload is necessary.
--- a/src/core/random-variable.cc Wed Feb 25 11:00:50 2009 +0100
+++ b/src/core/random-variable.cc Wed Feb 25 13:10:22 2009 +0100
@@ -264,9 +264,9 @@
: RandomVariable (UniformVariableImpl (s, l))
{}
-double UniformVariable::GetValue()
+double UniformVariable::GetValue(void) const
{
- return Peek()->GetValue();
+ return this->RandomVariable::GetValue ();
}
double UniformVariable::GetValue(double s, double l)
--- a/src/core/random-variable.h Wed Feb 25 11:00:50 2009 +0100
+++ b/src/core/random-variable.h Wed Feb 25 13:10:22 2009 +0100
@@ -176,10 +176,15 @@
UniformVariable(double s, double l);
/**
- * \brief Returns a random double with the specified range given by constructor
+ * \brief call RandomVariable::GetValue
* \return A floating point random value
+ *
+ * Note: we have to re-implement this method here because the method is
+ * overloaded below for the two-argument variant and the c++ name resolution
+ * rules don't work well with overloads split between parent and child
+ * classes.
*/
- double GetValue();
+ double GetValue (void) const;
/**
* \brief Returns a random double with the specified range