C++/CLI: value classes feel crippled

  • Thread starter Slawomir Lisznianski
  • Start date
S

Slawomir Lisznianski

Lack of support for SMFs in value classes limits their use quite a bit.

The C++/CLI Language Specification seem to contradict itself in a few
places regarding this matter too. For example, the code snippet at page
33 of C++/CLI Language Specification Working Draft 1.5, Jun, 2004 has a
point value class that uses constructors freely of various kinds. Yet
paragraph 21.4.1 of that same spec, states: "Value classes cannot have
SMFs (specifically, default constructor, copy constructor, assignment
operator, destructor, or finalizer."...)

The Beta 1 compiler of VC++ 2005 seems to agree with paragraph 21.4.1.

Slawomir Lisznianski [ www.rhapsodia.org ]
 
C

Carl Daniel [VC++ MVP]

Slawomir said:
Lack of support for SMFs in value classes limits their use quite a
bit.

The C++/CLI Language Specification seem to contradict itself in a few
places regarding this matter too. For example, the code snippet at
page 33 of C++/CLI Language Specification Working Draft 1.5, Jun,
2004 has a point value class that uses constructors freely of various
kinds. Yet paragraph 21.4.1 of that same spec, states: "Value classes
cannot have SMFs (specifically, default constructor, copy
constructor, assignment operator, destructor, or finalizer."...)

The Beta 1 compiler of VC++ 2005 seems to agree with paragraph 21.4.1.

See the post on Stan Lippman's blog at http://blogs.msdn.com/slippman

-cd
 
B

Brandon Bray [MSFT]

Slawomir said:
The C++/CLI Language Specification seem to contradict itself in a few
places regarding this matter too.

While Stan provided an excellent response regarding the rationale, I would
also encourage you to send us feedback on the language specification through
the MSDN Product Feedback Center.

http://labs.msdn.microsoft.com/productfeedback

We treat specification bugs just like product bugs. So if you're inclined,
I'd love to have issues reported so that I can fix them.

Thanks!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top