On Tuesday, 22 September 2015 at 15:53:22 UTC, Kagamin wrote:
Of course you didn't. In C you can mutate const object without cast. But it's not an issue because it's not what is usually done and usually const works as expected.

No. Const objects are read only. Writing to read only objects would be undefined behaviour. I.e. illegal and could make your computer crash if it is a hardware register or memory that does not allow writing. Const references can exhibit aliasing if they aren't marked as "restrict":

http://stackoverflow.com/questions/457441/does-restrict-help-in-c-if-a-pointer-is-already-marked-const

      • Re: cpp_binder, a... Ola Fosheim Grøstad via Digitalmars-d-announce
        • Re: cpp_binde... Paul O'Neil via Digitalmars-d-announce
          • Re: cpp_b... Ola Fosheim Grostad via Digitalmars-d-announce
            • Re: ... Marc Schütz via Digitalmars-d-announce
              • ... Kagamin via Digitalmars-d-announce
              • ... Ola Fosheim Grøstad via Digitalmars-d-announce
              • ... Kagamin via Digitalmars-d-announce
              • ... Ola Fosheim Grøstad via Digitalmars-d-announce
              • ... Kagamin via Digitalmars-d-announce
              • ... Ola Fosheim Grøstad via Digitalmars-d-announce
              • ... Kagamin via Digitalmars-d-announce
  • Re: cpp_binder, a not-yet-... Jacob Carlborg via Digitalmars-d-announce

Reply via email to