measure.cpp
/*
  TODO: Measure::setValue(key, value)

  Add a particular year's value to the Measure object. If a value already
  exists for the year, replace it.

  @param key
    The year to insert a value at

  @param value
    The value for the given year

  @return
    void

  @example
    std::string codename = "Pop";
    std::string label = "Population";
    Measure measure(codename, label);

    measure.setValue(1999, 12345678.9);
*/
:setValue(key, value)
Add a particular year's value to the Measure object. If a value already
exists for the year, replace it.
: setValue ( key value ) Add a particular year ' s value to the Measure object . If a value already exists for the year replace it .
void Measure::setValue(int key, double value){
  if(values.count(key) > 0){
    values.erase(key);
  }
    values.emplace(key, value);
}
void Measure :: setValue ( int key , double value ) { if ( values . count ( key ) > 0 ) { values . erase ( key ) ; } values . emplace ( key , value ) ; }
TODO: Measure::setValue(key, value)
Add a particular year's value to the Measure object.
TODO : Measure :: setValue ( key value ) Add a particular year ' s value to the Measure object .