From: Jorge Lodos (lodos_at_[hidden])
Date: 2006-04-17 18:52:29
> I found some corner cases while trying to implement Kevlin's idea.
> If you're interested, I can send you my letter to Kevlin.
Thanks, I'm interested :-)
> > 1. If operator== is not used there should be no need for holded
> > classes to implement it.
> > 2. If operator== is used, and the holded class does not
> define it, the
> > code must not compile.
> It's not possible. You may create "any" object in one TU and
> call operator== in other. A compiler doesn't know about other
> TUs. It just compiles current TU.
Assuming the holded object class is the same (and does not have operator==
in the interface), the behavior I want is that the TU not using
any::operator== does compile, while the TU using it does not. The expected
error would be operator== not defined for holded class. The conditions were
meant for a single TU. This can be achieved with not instantiated templates,
but not with boost::any which inherently needs run-time polimorphism :-(
In other words, what I would like is to have different (compiler generated)
boost::any classes. One without operator== in case it is not used. The other
needs the holded class operator== implementation and won't compile without
> Alexander Nasonov
> Project Manager
> Unsubscribe & other changes: