Whats the basis for C3633? 
Author Message
 Whats the basis for C3633?

I can understand the basis for most constraints, however this one is baffling.  Does anyone understand why this one exists?

I can work around this quit easily, I am just curious.

Compiler error C3633:

cannot define 'member' as a member of managed 'type' because of the presence of copy constructor 'constructor' on class 'class'

You cannot instantiate an unmanaged (__nogc) class that contains a copy constructor or an assignment operator, in a value type.



Sun, 24 Jul 2005 01:03:46 GMT  
 Whats the basis for C3633?
Quote:
> Compiler error C3633:

> cannot define 'member' as a member of managed 'type' because of the

presence of copy constructor 'constructor' on class 'class'
Quote:

> You cannot instantiate an unmanaged (__nogc) class that contains a copy

constructor or an assignment operator, in a value type.

Hi Jon,

It is becaues copy constructors and destructors are not supported on value
types.

--
Keiji Oenoki
Visual C++ Team
This posting is provided AS IS with no warranties, and confers no rights.



Tue, 09 Aug 2005 03:27:31 GMT  
 Whats the basis for C3633?
Thanks for the reply, but you just restated the error message.

I was just hoping someone would know why.

Usually anything that would generate a vtable entry would be forbidden in a value type.

Since values are sealed, copy constructors and destructors are not virtual and would require no vtable member.

I am still baffled why this is an constraint.  Of course I'll just live with it.


Quote:
> > Compiler error C3633:

> > cannot define 'member' as a member of managed 'type' because of the
> presence of copy constructor 'constructor' on class 'class'

> > You cannot instantiate an unmanaged (__nogc) class that contains a copy
> constructor or an assignment operator, in a value type.

> Hi Jon,

> It is becaues copy constructors and destructors are not supported on value
> types.

> --
> Keiji Oenoki
> Visual C++ Team
> This posting is provided AS IS with no warranties, and confers no rights.



Tue, 09 Aug 2005 08:27:57 GMT  
 Whats the basis for C3633?
Hi Jon,
Since value types don't support copy constructor, its members' copy
constructors won't get called. This is different from C++ semantic.

--
Keiji Oenoki
Visual C++ Team
This posting is provided AS IS with no warranties, and confers no rights.



Wed, 10 Aug 2005 02:28:02 GMT  
 Whats the basis for C3633?
This is yet another "You can not do it because it is not allowed." answer.

My question is still, what is rational behind it not being allowed?

V v1;
V v2 = V(v1);  // why should this be 'wrong' for a value type.

I do not think this is a bug.
I think it is a well thought out contraint that I do not understand the rational behind it.


Quote:
> Hi Jon,
> Since value types don't support copy constructor, its members' copy
> constructors won't get called. This is different from C++ semantic.

> --
> Keiji Oenoki
> Visual C++ Team
> This posting is provided AS IS with no warranties, and confers no rights.



Wed, 10 Aug 2005 04:11:53 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. Errors C2065,C3627,C3149,C3633 in My C++.NET Programming

2. Error C3633 when using certain classes as member variables

3. Integers and bases

4. Bases Conversion

5. Bases Conversion

6. how to displaying different number bases?

7. Numeric output in various bases and system values

8. Conversions of bases

9. C/C++ programmer required on project basis

10. Font code of search in data bases

11. Converting between bases

12. Qst: ODBC drivers for B-TREE bases or C/C++ lib's

 

 
Powered by phpBB® Forum Software