Generic programming ramifications of const by default

BCS ao at pathlink.com
Tue Jun 12 09:37:24 PDT 2007


Reply to Georg,

> I think parameter passing is a world separate from "other const or
> const-as-default" areas. Thus, having parameters behave differently
> from them poses no risk for confusion, and, IMHO, is a conceptually
> clean and intuitive choice. It also has a crystal clear perimeter,
> which dramatically reduces the mental strain of having to remember
> things.
> 

The issue is that a and b in this code are of different types if T is a reference 
type and that same type otherwise.

|void TFn(T)(T a)
|{
|  T b;
|}





More information about the Digitalmars-d mailing list