Re: Compiler chooses conv ctor - why?



Hello,

Victor Bazarov wrote:
Huh? Elimination of the copy is allowed, but not required. Even if it is forgone (the compiler decides to optimize it away), the copy-ctor has to be available _as_if_ it were used (12.8/15).

I know that checking of access or not would be stupid. It would involve
that the same program is ill-formed when not optimized and well-formed
when optimized. Assuming that access checking is an element of the copy
construction, and after 12.8[15] states that ,,an implementation is
allowed to omit the copy construction'' the situation has been not so
clear for me. Hopefully, newer working drafts have paragraph 12.8[16],
which unambiguously clears everything.

-- best regards

Cezary Noweta
.



Relevant Pages

  • Re: Compiler options (optimization) and INTERNAL COMPILER ERROR
    ... > Victor Bazarov wrote: ... > compiler back-end to be invoked by the linker. ... Rebuild all is what we always do, just for the purpose of tying up our ... If we drop one of them, no crash happens. ...
    (microsoft.public.vc.language)
  • Re: Protected classes within classes
    ... "Victor Bazarov" wrote in message ... > that even there you'll be encouraged to update your compiler... ...
    (comp.lang.cpp)
  • Re: VC++ 7.1 (.net 2003) compiler code optimization bug ?
    ... "Victor Bazarov" wrote: ... > Are you sure the problem is due to the compiler bug and not to the fact ... is zero which is it in the source file. ...
    (microsoft.public.vc.language)
  • Re: replacement for macro with # and ##
    ... > Victor Bazarov a écrit: ... >> done before the compiler gets to it. ... Templates are a way to make ... String literals have internal linkage, ...
    (comp.lang.cpp)
  • Re: Incomplete type as template argument
    ... "Victor Bazarov" wrote in message ... >> struct B ... >> Could someone please explain to me when the compiler actually does ... >> the template expansion, and is this method of using incomplete types ...
    (comp.lang.cpp)