some template questions

Daniel Keep daniel.keep.lists at gmail.com
Tue May 23 01:45:05 PDT 2006



Daniel Keep wrote:
> 
> [snip]
> #     else static if( chr[0] <= str[0] )
> #         const char[] insertChar = chr ~ str;
> #     else
> #         const char[] insertChar = str[0..1] ~ insertChar!(chr, #
> str[1..$]);

Oops, stupid mail program.  That should be

# const char[] insertChar = str[0..1] ~ insertChar!(chr, str[1..$]);

Also, you could easily generalise this by changing 'char' to whatever
type you want to use.  That is left as an exercise for the reader :P

	-- Daniel

-- 

v1sw5+8Yhw5ln4+5pr6OFma8u6+7Lw4Tm6+7l6+7D
a2Xs3MSr2e4/6+7t4TNSMb6HTOp5en5g6RAHCP    http://hackerkey.com/



More information about the Digitalmars-d-learn mailing list