From: "David Abrahams" <[EMAIL PROTECTED]> > > Hi, > > I'm wondering whether the get_pointer function used by mem_fn et > al. is really justified. Since you can't invoke a member function on a > null pointer anyway, why not simply use &*p for this purpose?
The original reason for using get_pointer in mem_fn is that mem_fn does not require get_pointer(p) to return &*p, or p.get(), or a raw pointer. It only expects an object with operator->* defined. Another reason is that supplying a get_pointer() for an existing type is (potentially) less intrusive than enabling the &*p syntax. On the other hand... the ((*p).*f)(...) form would work with most smart pointers and iterators, so it might be worth exploring. _______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost