Lecture Notes for Advanced Programming II

6 May 2004 - Expression Templates


Given that a temperature can be only normal or abnormal, if you can figure out the number of abnormal temperatures (and know the total number of temperatures), then the number of normal temperatures is

template <class Temps>
unsigned normal_count(const Temps & temps)
  return temps.count() - abnormal_count(temps)


This page last modified on 6 May 2004.