
From: "Thorsten Ottosen" <nesotto@cs.auc.dk>
"David Abrahams" <dave@boost-consulting.com> wrote in message news:uk6mo2ylf.fsf@boost-consulting.com... | "Thorsten Ottosen" <nesotto@cs.auc.dk> writes: | | > A "value object" implies something that behaves as an int; a | > "polymophic object" implies something that needs to allocated | > dynamically and which has virtual functions. | | A polymorphic object doesn't need to be allocated dynamically.
if you want it to act polymophic you have to.
Pass it to a function taking a reference to a base class; it acts polymorphically. Where the object is allocated is orthogonal.
| > trying to make a polymorphic object behave like a value object is | > confusing a best. | | Who does it confuse? Pimpl is a commonly used and well understood | pattern for doing just that.
Pimpl is an ugly hack for compilation firewalls.
Regardless of your opinion of the technique, Dave's statement holds. -- Rob Stewart stewart@sig.com Software Engineer http://www.sig.com Susquehanna International Group, LLP using std::disclaimer;