Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / Managed C++ / February 2008

Tip: Looking for answers? Try searching our database.

In C++ /CLI is there a "MyClass( ) : this( )" type of constructor like in C#?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Howard Swope - 27 Feb 2008 21:45 GMT
Does this type of thing exist in C++ /CLI as in C#

public class A

{

   public A(int foo)

   {

   }

   public A( ) : this(0)

   {

   }

}

???

Thanks

Signature

Howard Swope [hswope.swopeATnavteqDOTcom]
Senior Software Developer
Media Development
Navteq Traffic [http://www.traffic.com]

David Anton - 28 Feb 2008 00:01 GMT
No - calls to same-class constructors are not allowed in C++.  Someone else
can probably better explain the rational for this restriction.
Signature

http://www.tangiblesoftwaresolutions.com
C++ to C#
C++ to VB
C++ to Java
Instant C#: VB to C#
Instant VB: C# to VB
Instant C++: VB or C# to C++/CLI
Java to VB & C# Converter: Java to VB or C#

> Does this type of thing exist in C++ /CLI as in C#
>
[quoted text clipped - 19 lines]
>
> Thanks
Bo Persson - 28 Feb 2008 18:16 GMT
> No - calls to same-class constructors are not allowed in C++.
> Someone else can probably better explain the rational for this
> restriction.

It just wasn't considered important enough during the standardisation
process. There are some intricate details in defining exactly what it
means, and when the object is supposed to be "fully constructed".

In the next revision of the C++ standard, this will have been worked
out.

Bo Persson

>> Does this type of thing exist in C++ /CLI as in C#
>>
[quoted text clipped - 15 lines]
>>
>> }

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.