H
Hicham Mouline
hi,
I have a class an excerpt of which is:
class histo_data {
public:
///
/// Public Types
///
typedef std::list<entry>::const_iterator const_iterator;
typedef std::list<entry>::iterator iterator;
typedef std::list<entry>::const_reverse_iterator const_reverse_iterator;
typedef std::list<entry>::reverse_iterator reverse_iterator;
typedef std::list<entry>::reference reference;
typedef std::list<entry>::const_reference const_reference;
typedef std:air<const_iterator, const_iterator> const_range_t;
typedef std:air<iterator, iterator> range_t;
///
/// Constructors
///
histo_data(const_iterator begin, const_iterator end);
private:
std::list<entry> data_;
};
"entry" is a struct with boost::gregorian::date and other primitive types.
I want to make an object histo_data which contains all the dates from
1/1/1970 to 1/1/2030 and all other primitive types are 0.
Ideally, I would like to write it along the lines of:
const histo_data zero_histo_data( ... , .... );
1. I suppose I need a different constructor. Make it templated on the
iterator type?
2. Make a new iterator to entry and pass these 2 iterators to the
constructor?
Regards,
I have a class an excerpt of which is:
class histo_data {
public:
///
/// Public Types
///
typedef std::list<entry>::const_iterator const_iterator;
typedef std::list<entry>::iterator iterator;
typedef std::list<entry>::const_reverse_iterator const_reverse_iterator;
typedef std::list<entry>::reverse_iterator reverse_iterator;
typedef std::list<entry>::reference reference;
typedef std::list<entry>::const_reference const_reference;
typedef std:air<const_iterator, const_iterator> const_range_t;
typedef std:air<iterator, iterator> range_t;
///
/// Constructors
///
histo_data(const_iterator begin, const_iterator end);
private:
std::list<entry> data_;
};
"entry" is a struct with boost::gregorian::date and other primitive types.
I want to make an object histo_data which contains all the dates from
1/1/1970 to 1/1/2030 and all other primitive types are 0.
Ideally, I would like to write it along the lines of:
const histo_data zero_histo_data( ... , .... );
1. I suppose I need a different constructor. Make it templated on the
iterator type?
2. Make a new iterator to entry and pass these 2 iterators to the
constructor?
Regards,