#include "stdafx.h"
using namespace System;
class ClassMember {};
ref class RefClassMember {};
value class ValueClassMember {};
class Class
{
public:
ValueClassMember vc;
ValueClassMember *pvc;
ClassMember c;
ClassMember *pc;
int x;
void write() { Console::WriteLine("Class x: {0}", x); }
};
ref class RefClass
{
public:
RefClassMember rc;
RefClassMember ^hrc;
ValueClassMember vc;
ValueClassMember ^hvc;
ValueClassMember *pvc;
ClassMember *pc;
int x;
void write() { Console::WriteLine("RefClass x: {0}", x); }
};
value class ValueClass
{
public:
RefClassMember ^hrc;
ValueClassMember vc;
ValueClassMember ^hvc;
ValueClassMember *pvc;
ClassMember *pc;
int x;
void write() { Console::WriteLine("ValueClass x: {0}", x); }
};
class ClassChildClassParent : public Class {};
ref class RefClassChildRefClassParent : public RefClass {};
void main()
{
Class _class;
RefClass refclass;
ValueClass valueclass;
RefClass ^hrefclass = gcnew RefClass();
ValueClass ^hvalueclass = gcnew ValueClass();
Class *pclass = new Class();
ValueClass *pvalueclass = & valueclass;
Class &rfclass = *new Class();
ValueClass &rfvalueclass = valueclass;
_class.x = 1;
refclass.x = 1;
valueclass.x = 1;
hrefclass->x = 1;
hvalueclass->x = 1;
pclass->x = 1;
pvalueclass->x = 1;
rfclass.x = 1;
rfvalueclass.x = 1;
_class.write();
refclass.write();
valueclass.write();
hrefclass->write();
hvalueclass->write();
pclass->write();
pvalueclass->write();
rfclass.write();
rfvalueclass.write();
}