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
To: boost-users@lists.boost.org 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@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
Add more friends to your messenger and enjoy! Go to http://messenger.yahoo.com/invite/