Re: basic_string ctor



"Carl Daniel [VC++ MVP]" <cpdaniel_remove_this_and_nospam@xxxxxxxxxxxxxxx>
wrote in message news:eUe10xwWFHA.2768@xxxxxxxxxxxxxxxxxxxxxxx
> No, it's not. The committee was worried about the cost of the extra if()
in
> the constructor being too high (misplaced premature optimization, IMO).

The problem is that a library function doesn't have the luxury of
deciding when/where the time is right to optimize. If the optimization was
not written into the standard, it could never be made.

(however, the same argument could be made for "delete null", but there the
extra if() is required by the standard)

--
--
Truth,
James Curran
[erstwhile VC++ MVP]

Home: www.noveltheory.com Work: www.njtheater.com
Blog: www.honestillusion.com Day Job: www.partsearch.com


.


Loading