Boost logo

Boost :

Subject: Re: [boost] Formal Review Request: TypeErasure
From: Dave Abrahams (dave_at_[hidden])
Date: 2012-06-14 20:20:33


on Wed Jun 13 2012, "Simonson, Lucanus J" <lucanus.j.simonson-AT-intel.com> wrote:

> Dave Abrahams wrote:
>>> that the scope of TypeErasure was to replace inheritance–based
>>> polymorphism whenever possible.
>
>> That's definitely one useful way to apply it.
>
> I would say the scope of the library is to provide (type safe) runtime
> polymorphism whenever inheritance-based polymorphism is not possible.

Seriously? So, you would dispense with boost/std::function because an
inheritance-based approach is possible?

> I'd question the value of replacing legacy inheritance based type
> systems with TypeErasure based type system for its own sake.

I don't think I ever suggested that one should do that. Although, if
you have the time, it would make an interesting experiment, and might
even show overall value.

> It needs to enable something worthwhile or I'd rather the developer
> effort go elsewhere. I'm not disagreeing with Dave, I'm just saying
> its usefulness needs to be evaluated on a case by case basis.

Sure. For new code, it's reasonable to consider a value-based paradigm
in lieu of legacy inheritance paradigms.

-- 
Dave Abrahams
BoostPro Computing
http://www.boostpro.com

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk