other array types than char in templates?

Daniel Keep daniel.keep.lists at gmail.com
Tue May 29 17:09:00 PDT 2007



dennis luehring wrote:
> what is the reason for allowing this
> 
> template test(char[] bla)
> {
> ....
> }
> 
> 
> but not
> 
> template test(int[] bla)
> {
> ....
> }
> 
> or other bultin(own) types?
> 
> ciao dennis

I think it's because arguments to a template become part of its mangled
name.  Integers and floats are easy, as are actual strings, but to
support arbitrary types, Walter would either need some kind of generic
serialisation setup, or find a new way of mangling templates.

At least, that's how I understand it :)

	-- Daniel

-- 
int getRandomNumber()
{
    return 4; // chosen by fair dice roll.
              // guaranteed to be random.
}

http://xkcd.com/

v2sw5+8Yhw5ln4+5pr6OFPma8u6+7Lw4Tm6+7l6+7D
i28a2Xs3MSr2e4/6+7t4TNSMb6HTOp5en5g6RAHCP  http://hackerkey.com/



More information about the Digitalmars-d mailing list