CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2

Threaded View

  1. #1
    Join Date
    Jun 2006

    [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.

    Thank you

    Last edited by Nigel Norfolk; June 22nd, 2006 at 04:25 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Windows Mobile Development Center

Click Here to Expand Forum to Full Width

On-Demand Webinars (sponsored)