tcak:

void dataProcessor( string giveMeAllYourData ){}

dataProcessor( cast( immutable )( importantData[5 .. 14] ) );



With Const,

void dataProcessor( in char[] giveMeAllYourData ){}

dataProcessor( cast( const )( importantData[5 .. 14] ) );

Don't cast to const/immutable unless you have a good reason to do it, and you know what you are doing (and most times you don't know it). More generally, minimize the number of cast() in your D programs. You can use a search to count how many "cast(" there are in your whole D codebase, and you can try to reduce that number.

Bye,
bearophile

Reply via email to