Re: Compiler error or? Microsoft VC++ v6.0

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: Torstein Hansen (torsteinRemoveThis_at_hansen.as)
Date: 02/17/04


Date: Tue, 17 Feb 2004 21:34:22 GMT


"Frank Hickman" <fhickman_nosp@m_noblesoft.com> wrote in message
news:ltudncxV77EuG6_d4p2dnA@comcast.com...
> Because your passing an unsigned long the compiler can only assume
your
> passing a reference so it uses the constructor that uses a reference.
Since
> 0 is in effect null this works, 1 is not so it does not.
>
> --
> Frank

I'm still not completely satisfied that all type safety is blown on
constants that just happens to be zero..

Oh well..



Relevant Pages

  • Re: Smart pointers of const objets
    ... >>in the class constructor do not produce any output when calling foo(A ... > object directly to a reference if it is the exact type of a sub type ... (contrary to the link you provided, where a conversion is needed). ... I would assume that no compiler ...
    (comp.lang.cpp)
  • Re: Arguments with a target attribute
    ... If argument passing were really ... strictly do pass by reference. ... simply optimized the statements in the subroutine, ... If the compiler strictly did pass by reference ...
    (comp.lang.fortran)
  • Re: Is this a compiler bug?
    ... //Begin snippet ... create a temporary funcand pass a reference to A to B's ... variable inside B's constructor) ... This is not a compiler bug, ...
    (microsoft.public.vc.language)
  • Re: Passing an array control reference - accessing all values
    ... The LV compiler is pretty good at working out where data copies are ... and passing an array to a sub-vi will only result in a copy ... then no copy will be made (pass by reference). ... Passing a LV reference involves using VI server and so on and is ...
    (comp.lang.labview)
  • Re: const &
    ... Again, I'm not sure if I got correctly, but what I meant that the compiler ... reference (Deceived by the fact that the function won't change the const ... > passing reference. ...
    (microsoft.public.vc.language)