HelloA const copy ensures the copied value remains unchanged, providing safety and predictability. If the original is const, copying it as non-const could introduce unintended side effects. To modify a copied value, create a mutable copy explicitly. For file systems, copying write-protected files maintains their attributes for security reasons. To modify them, change the file permissions after copying. There isn't a direct way to tell the compiler to discard "const" or "immutable" attributes during a copy. You need to cast away constness explicitly where necessary.
- copy must be const?!? Dom DiSc via Digitalmars-d-learn
- Re: copy must be const?!? Dom DiSc via Digitalmars-d-learn
- Re: copy must be const?!... Jonathan M Davis via Digitalmars-d-learn
- Re: copy must be const?!... Dom DiSc via Digitalmars-d-learn
- Re: copy must be con... Jonathan M Davis via Digitalmars-d-learn
- Re: copy must be con... Quirin Schroll via Digitalmars-d-learn
- Re: copy must be con... Dom DiSc via Digitalmars-d-learn
- Re: copy must be con... Dom DiSc via Digitalmars-d-learn
- Re: copy must be... Jonathan M Davis via Digitalmars-d-learn
- Re: copy must be... Dom DiSc via Digitalmars-d-learn
- Re: copy must be const?!? swigy food via Digitalmars-d-learn