Re: Should this code compile?
From: Rolf Magnus (ramagnus_at_t-online.de)
Date: 02/23/05
- Next message: Brad Pepers: "Simple code compile problem?"
- Previous message: puzzlecracker: "find a string in a grid"
- In reply to: BigMan: "Re: Should this code compile?"
- Next in thread: E. Robert Tisdale: "Off Topic: Should this code compile?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Wed, 23 Feb 2005 20:31:29 +0100
BigMan wrote:
> 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?!
Because the correctness of code doesn't depend on optimizations.
> This and other such requirements should be relaxed in order to make the
> language even more powerful!
And if it were, you might write code that needs the copy constructor on one
compiler an doesn't on another, i.e. your code would be unportable.
- Next message: Brad Pepers: "Simple code compile problem?"
- Previous message: puzzlecracker: "find a string in a grid"
- In reply to: BigMan: "Re: Should this code compile?"
- Next in thread: E. Robert Tisdale: "Off Topic: Should this code compile?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|