HaloO, John M. Dlugosz wrote:
- const int& is preferred over int/int&. - const int* is preferred over int*.
You mean when in each case both versions are defined as overloads only the preferred ones are ever called? C++ is the other way around. For an int* argument the int* version is preferred if both are available. For a const int* the int* is not applicable, thus not choosen. Now I understand your motivation to mangle the traits into the (dynamic) dispatch rules. But note that I would not call the C++ compile time choice dispatch. I think the standard doesn't either. It's called overload resolution. Perl 6 can't do that at compile time unless *all* targets are available as rw and readonly variants. Regards, TSa. -- "The unavoidable price of reliability is simplicity" -- C.A.R. Hoare "Simplicity does not precede complexity, but follows it." -- A.J. Perlis 1 + 2 + 3 + 4 + ... = -1/12 -- Srinivasa Ramanujan