anyway to set a const object after the fact?
aliak
something at something.com
Mon Oct 29 21:50:32 UTC 2018
Hi, so if you have this piece of code:
struct C {
void f() {
string[] others;
const string[] restArgs;
foreach (i, arg; args) {
if (isValidArg(arg)) {
restArgs = args[i + 1 .. $];
break;
}
others ~= arg;
}
// "others" is a list of args before the valid arg is
encountered
// "restArgs" is a list that is the args after the valid arg
}
}
Is there anyway to set a const object after declaring it in the
above context?
Cheers,
- Ali
More information about the Digitalmars-d-learn
mailing list