473,386 Members | 1,798 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Delegating Constructor only supported by native class objects?

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.)
Nov 17 '05 #1
3 1534
Stephen R. G. Fraser wrote:
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
Nov 17 '05 #2
Carl Daniel [VC++ MVP] wrote:
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
Nov 17 '05 #3
Carl Daniel [VC++ MVP] wrote:
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.

--
Brandon Bray, Visual C++ Compiler http://blogs.msdn.com/branbray/
Bugs? Suggestions? Feedback? http://msdn.microsoft.com/productfeedback/
Nov 17 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Jun | last post by:
I have following script <script> var Animal = function(name){ this.name = name; } Animal.prototype.eat = function (food) {
7
by: Sandy | last post by:
Is there any way to write a "single constructor" that can be called using either 1 or 2 arguments. But without using default arguments. Actually i don't need this. Just asking as some other guy...
5
by: Devika | last post by:
hi, I understand the need of virtual destructor.but virtual constructor is not supported in c++.but basically why we need to have virtual constructor?? thx in advance Devika
16
by: plmanikandan | last post by:
Hi, I have doubts reg virtual constructor what is virtual constructor? Is c++ supports virtual constructor? Can anybody explain me about virtual constructor? Regards, Mani
12
by: Edward Diener | last post by:
Given value class X { public: // Not allowed: X():i(100000),s(10000) { } // Allowed void InitializeDefaults() { i = 100000; s = 10000; } private: int i;
3
by: ThisBytes5 | last post by:
I am using an attribute on the properties of my object to help with parsing of data. The attribute will determine if the current property is to be populated based on the version of the data. As...
26
by: Patient Guy | last post by:
The code below shows the familiar way of restricting a function to be a method of a constructed object: function aConstructor(arg) { if (typeof(arg) == "undefined") return (null);...
74
by: Zytan | last post by:
I have a struct constructor to initialize all of my private (or public readonly) fields. There still exists the default constructor that sets them all to zero. Is there a way to remove the...
3
by: navneet.krg | last post by:
create a class myClass using prototype.js's Class.create() then create an object foo of that myClass then "object.constructor" will return "function Object() { }" should be myClass does...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.