Tuesday, November 13, 2007

Little Sugar : Casting away constant ness

In C++ if you create a constant object , say

const String A("Hello World");

String& B = const_cast(A);

can be used to create a non constant reference to the so called constant object and hence
manipulate it .

No comments: