measure.cpp
/*
  TODO: Measure::getDifference()

  Calculate the difference between the first and last year imported. This
  function should be callable from a constant context and must promise to not
  change the state of the instance or throw an exception.

  @return
    The difference/change in value from the first to the last year, or 0 if it
    cannot be calculated

  @example
    Measure measure("pop", "Population");
    measure.setValue(1999, 12345678.9);
    measure.setValue(2001, 12345679.9);
    auto diff = measure.getDifference(); // returns 1.0
*/
:getDifference()
Calculate the difference between the first and last year imported. This
function should be callable from a constant context and must promise to not
change the state of the instance or throw an exception.
: getDifference () Calculate the difference between the first and last year imported . This function should be callable from a constant context and must promise to not change the state of the instance or throw an exception .
double Measure::getDifference(){
  double first = values.begin()->second;
  double last = values.end()->second;
  return last-first;
}
double Measure :: getDifference ( ) { double first = values . begin ( ) -> second ; double last = values . end ( ) -> second ; return last - first ; }
TODO: Measure::getDifference()
Calculate the difference between the first and last year imported.
TODO : Measure :: getDifference () Calculate the difference between the first and last year imported .