Listing 5: Exposing sequences from the measurements class
public: typedef std::vector<std::pair<double, Date> > MeasurementsCollection; typedef MeasurementsCollection::const_iterator const_iterator; typedef iterator_to_member< const_iterator, std::pair<double, Date>, const double > const_value_iterator; MeasurementsCollection::size_type size() { return m_vectMeasurements.size(); } const_iterator begin() { return m_vectMeasurements.begin(); } const_iterator end() { return m_vectMeasurements.end(); } const_value_iterator value_begin() { return const_value_iterator( m_vectMeasurements.begin(), &std::pair<double, Date>::first ); } const_value_iterator value_end() { return const_value_iterator( m_vectMeasurements.end(), &std::pair<double, Date>::first ); } private: MeasurementsCollection m_vectMeasurements; End of Listing