
On 11/9/04 9:18 PM, "Jonathan Turkanis" <technews@kangaroologic.com> wrote:
"Joe Gottman" <jgottman@carolina.rr.com> wrote in message news:cmro5r$o56$1@sea.gmane.org...
I used base_from_member today for the first time. It got me out of a sticky situation, but I think it could use a few modifications. Since it is designed to be used as a base class but does not have any virtual functions, the copy constructor, assignment operator, and destructor should all be protected.
I seem to remember someone proposing something similar for std::unary_function ;-) The argument seems even weaker here: base_from_member is designed for private inheritance, so it's hard to see how it can be misused by clients of a derived class.
There's one change I'd like to see: the constructors should take rvalue references ;-)
But that would prevent lvalue references from ever being used. However, since we can't explicitly specify the template parameters for a templated constructor, could reference arguments (of either type) ever be used? -- Daryle Walker Mac, Internet, and Video Game Junkie darylew AT hotmail DOT com