June 22nd, 2006, 04:19 PM
[RESOLVED] const corrected please in managed classes
In the introduction to the C++/CLI Langauge Specification it is stated that one of the goals used in the design of C++/CLI was to
"Provide first-class support for Standard C++ features ... for all types including CLI classes."
Unfortunately, there is a major ommision in C++/CLI, namely const correctness for managed classes. In particular, methods in these classes cannot be const (although parameters and return values can be). Experienced C++ programmers are careful to make methods const where appropriate as this provides a powerful compile-time check on program semantics.
Recent trends in C++ have stressed the importance of compile-time checks (for example, Andrei Alexandrescu's excellent book 'Modern C++ Design' and the associated library Loki.) Its a shame that C++/CLI takes a retrograde step in removing facilities for const correctness.
May I plea for const correctness to be introduced in a later version of C++/CLI.
Last edited by Nigel Norfolk; June 22nd, 2006 at 04:25 PM.
Click Here to Expand Forum to Full Width
This is a CodeGuru survey question.