Do we really need const?

Janice Caron caron800 at googlemail.com
Tue Sep 18 05:12:13 PDT 2007


On 9/18/07, Bill Baxter <dnewsgroup at billbaxter.com> wrote:
> So the compiler generates 2^N versions for an N-parameter method?

Still only two ... I /think/

The first version is the version in which all information is known.
This is the version in which optimal decisions are assumed at the
callee site, and may be taken at the caller site.

The second version is the version in which no information is known. In
this version, everything gets passed by the default behaviour.

So, at the callee site, either all information about the function is
known, in which case we call version A, or it isn't in which case we
call version B.

I think that would work. It may not be /quite/ as efficient as the 2^N
possibility you mentioned, but it would certainly be more efficient
than the status quo (version B for everything).



More information about the Digitalmars-d mailing list