Boost logo

Boost Users :

Subject: Re: [Boost-users] [accumulators] Help required for using UDT as Sample
From: dhruva (dhruva_at_[hidden])
Date: 2009-02-25 00:53:03


Apologies for all the noise, I found my coding error. The operator overloading had to be 'const'. bool operator < (const acc_sample &rhs) const { return _data._value < rhs._data._value; } Instead of: bool operator < (const acc_sample &rhs) { return _data._value < rhs._data._value; } Thanks, -dhruva ----- Original Message ---- > From: Eric Niebler <eric_at_[hidden]> > To: boost-users_at_[hidden] > Sent: Wednesday, 25 February, 2009 10:37:42 AM > Subject: Re: [Boost-users] [accumulators] Help required for using UDT as Sample > > dhruva wrote: > > I have my own data type, time stamp and value. I would like to get the min > Sample with corresponding time stamp. > > > > class time_val { > > public: > > time_t _time; > > double _value; > > > > /* I have overloaded operators: <, >, ==, != */ > > /* Have provided copy constructor */ > > }; > > > > When I try: > > accumulator_set< time_val, features > acc; > > > > I get a whole lot of compilation errors. Is there any way I can make a UDT as > a sample? > > That should just work. Can you provide a complete example? > > -- Eric Niebler > BoostPro Computing > http://www.boostpro.com > _______________________________________________ > Boost-users mailing list > Boost-users_at_[hidden] > http://lists.boost.org/mailman/listinfo.cgi/boost-users Add more friends to your messenger and enjoy! Go to http://messenger.yahoo.com/invite/


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net