Re: Should this code compile?

From: BigMan (BigMan_at_abv.bg)
Date: 02/23/05


Date: 23 Feb 2005 10:38:21 -0800

Yes, the copy ctor DOES change the original - it transfers ownership of
a resource that is too expensive to copy (e.g. a huge amount of
memory).
All this stuff about copy initilialization, direct initialization and
the like seem to me rather silly... Most compilers will NOT call the
copy ctor anyway in order to compile the above piece of code, so why
should the standard require that the copy ctor be callable?!
This and other such requirements should be relaxed in order to make the
language even more powerful!



Relevant Pages

  • Re: Should this code compile?
    ... > All this stuff about copy initilialization, ... Most compilers will NOT call the ... > copy ctor anyway in order to compile the above piece of code, ...
    (comp.lang.cpp)
  • Re: Inadequate error message C2228
    ... Vladimir Grigoriev wrote: ... In 0, B) copy ctor could ... be omitted too (there is no sequence point after a whole ... It is interesting to note that different compilers behave differently. ...
    (microsoft.public.vc.language)
  • Re: Inadequate error message C2228
    ... B) copy ctor could be omitted ... too (there is no sequence point after a whole expression), ... It is interesting to note that different compilers behave differently. ... Vladimir Grigoriev ...
    (microsoft.public.vc.language)
  • Re: x86 and C++
    ... the newly aquired memory, to the specified ctor function, if any. ... object (how it knows how many objects there are is implimentation specific), ... __cdecl: pushes arguments in reverse order. ...
    (comp.lang.cpp)
  • Re: size of huge memory
    ... > we expand the memory size to load huge amount of data? ... This only applies to old DOS compilers. ... You could address a small amount of memory quickly or a large ... The huge memory model was the largest, which you set by invoking the ...
    (comp.lang.c)