
16 Jul
2005
16 Jul
'05
2:24 p.m.
David Abrahams wrote:
FYI, I might tend to use a dual_state object that either yields a contained _reference_ or the result of invoking a function, because you usually don't want to pay for copy construction of a contained object if you don't have to, and it feels nonuniform to have lightweight copy only when the default is going to be used.
Well, I had a lot of problems with bottlenecks in VC7.0 code related to redundant copy operations, so I'm very afraid of extra copies. But we can have both copy- and nocopy- versions. The version with a copy operation could be simpler to use, so the both versions have reasons to exist. Andrey