
On 6/28/06, Joaquín Mª López Muñoz <joaquin@tid.es> wrote:
During some conversations with a colleague I came up with a very sketchy realization of what could be converted, if there is interest, in a flyweight library. Please see flyweight.hpp at Vault/Patterns:
Additionally, comparison of flyweight objects can be made faster than that of the underlying type T, since we it reduces to pointer comparison
Very nice! A few comments: - What's y? void swap(flyweight& x) { std::swap(x.h,y.h); } - I'm not convinced operator< should be in terms of the pointer. x<y being different from (T&)x < (T&)y seems like an easy source of errors. ~ Scott McMurray <OT> Has anyone proposed a good way of doing wrapping for C++0x? That problem keeps coming up...