"immutable string" vs "const string*"

2018-09-09 Thread Christian Mayer via Digitalmars-d-learn
In regard of performance, why should I rather use "immutable string" over "const string*" (or just "string*")? For example, as a function argument. When I have a loop which calls a function with a string argument. (And to avoid function inling in this example the function call is also used in

Re: "immutable string" vs "const string*"

2018-09-09 Thread Christian Mayer via Digitalmars-d-learn
On Sunday, 9 September 2018 at 08:14:41 UTC, rikki cattermole wrote: Are you aware that a string is just an alias of immutable(char)[]? Yes, I'm aware of that. But it's the same, for example, with just one char. "immutable char" vs "const char*". Or int, or any other data type. As of my