Boost logo

Boost :

Subject: Re: [boost] [Booster] Or boost is useless for library developers
From: Scott McMurray (me22.ca+boost_at_[hidden])
Date: 2010-05-20 14:11:51


On 20 May 2010 18:38, Artyom <artyomtnk_at_[hidden]> wrote:
>
> You just said what I was thinking about. There is some kind
> of Urban Myths in Boost community
>
> - Concepts are **always** better then inheritance
>
> Sad.
>

I don't consider this one an urban myth.

- If you need different types, then inheritance doesn't work feasibly,
so concepts are the only choice, and are thus better by default

- If inheritance can be feasibly done, then a single virtualizing
wrapper can be written for the concept. Since the overhead of this is
just in the virtual tables and such, it's the same as would be added
in making it natively virtual (and all the wrapping instantiation of
templates can be done in source files, making the templating
completely invisible to the users of the virtual interface, and
meaning that there's no opportunity for multiple-instantiation
"bloat"). So since it allows additional options at negligible -- if
any -- cost, it's better.

Unless you have a counterexample?


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