Delegating Constructor only supported by native class objects?

G

Guest

Are or will delegating constructors (constructors that can call sibling
constructors) be available for ref classes or only for native classes?

The CLI/C++ specs seems to say that it is a native class thing so I just
want to make sure so that I can include/exclude it from the revision of my
book.

(I also can't seem to get it to work for a ref class, if it is supported.)
 
C

Carl Daniel [VC++ MVP]

Stephen said:
Are or will delegating constructors (constructors that can call
sibling constructors) be available for ref classes or only for native
classes?

The CLI/C++ specs seems to say that it is a native class thing so I
just want to make sure so that I can include/exclude it from the
revision of my book.

(I also can't seem to get it to work for a ref class, if it is
supported.)

Forwaring constructors aren't supported by the C++ language at all. There's
currently a proposal to the C++ committee to add that ability in the next
rev of the C++ standard, but that's still 4+ years away.

That said, I haven't looked at what the C++/CLI spec says in this regard.
If they are supported, I'd expect it would be for ref types only, since
they're definitely NOT supported for native types.

-cd
 
C

Carl Daniel [VC++ MVP]

Carl said:
Forwarding constructors aren't supported by the C++ language at all.
There's currently a proposal to the C++ committee to add that ability
in the next rev of the C++ standard, but that's still 4+ years away.

That said, I haven't looked at what the C++/CLI spec says in this
regard. If they are supported, I'd expect it would be for ref types
only, since they're definitely NOT supported for native types.

Indeed, the C++/CLI spec only mentions this feature in the "Future
Directions" section, so I'd say that for Whidbey the answer is clearly "not
supported for any types".

-cd
 
B

Brandon Bray [MSFT]

Carl said:
Indeed, the C++/CLI spec only mentions this feature in the "Future
Directions" section, so I'd say that for Whidbey the answer is clearly
"not supported for any types".

That's right. After the C++ standards committee took to designing parts of
the feature, the Visual C++ team backed off of implementing this feature.
Anytime the standards committee starts working on a design, it's very risky
for us to implement it is a release product.
 

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