
Hi I needed to compare 2 boost::any values for equality, and the only reference to this problem I found was http://lists.boost.org/MailArchives/boost-users/msg01572.php which I think is not correct. I have the following implementation working (whole file attached): In boost::any: bool operator==(const any & rhs) const { return content ? content->clon(rhs.content) : rhs.content == 0; } In boost::any::placeholder: virtual bool clon(placeholder * rhs) const = 0; In boost::any::holder: virtual bool clon(placeholder * rhs) const { try { if (typeid(*rhs) != typeid(*this)) return false; } catch( bad_typeid & ) { return false; } return *static_cast<holder<ValueType> *>(rhs) == *this; } bool operator==(const holder<ValueType>& rhs) const { return held == rhs.held; } While this works, now the implementation depends on RTTI, and the template parameter needs to know how to compare to itself. Probably an #ifdef should be used in the new code to maintain compatibility. Please criticize this code, and offer any suggestion you may have. I'm willing to do some work if needed (docs?) in order to get equality checking added to boost::any. Thank you for boost :-) Best regards Jorge -----Original Message----- From: boost-bounces@lists.boost.org [mailto:boost-bounces@lists.boost.org] On Behalf Of Vladimir Pozdyayev Sent: Wednesday, January 19, 2005 2:10 AM To: boost@lists.boost.org Subject: Re: [boost] Re: mail problems David Abrahams wrote: DA> It sounds like a problem on your end. Am I missing something? Well, maybe the right question should be like "is that fixable on the boost side?"... The point is, up to this moment only boost have had problem with that address. And mail.ru support claims they never throw incoming mail away without notification... 's not that I received one. Ah, it's all well that ends well :) . Rene Rivera wrote: RR> The only thing I could do was to activate the vault account. Although RR> the email verification for the vault is working again, the OP must have RR> gotten it before I fixed that yesterday. Thanks. -- Best regards, Vladimir Pozdyayev. _______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost