P
Peter Oliphant
Here is a case where something that shouldn't compile does. Note below that
Test_Method() only accepts a pointer to Test_Struct as an parameter, but it
will compile with a value instance as a parameter.
For context, I'm using VS C++.NEW 2005 Express with clr:/pure syntax. I
submitted this as a bug report, link below:
http://lab.msdn.microsoft.com/produ...edbackid=ef3c8d9e-75e2-4916-87ee-640a4de75f39
Source below:
// Test_Compiler.cpp : main project file.
#include "stdafx.h"
using namespace System;
value struct Test_Struct
{
long x ;
} ;
ref class My_Class
{
public:
My_Class() {}
~My_Class() {}
private:
void Test_Compiler()
{
Test_Struct info ;
Test_Method( info ) ; // shouldn't compile, but does!!!
Test_Method( %info ) ; // ok
}
void Test_Method( Test_Struct^ info ) {}
} ;
int main(array<System::String ^> ^args)
{
return 0 ;
}
[==P==]
Test_Method() only accepts a pointer to Test_Struct as an parameter, but it
will compile with a value instance as a parameter.
For context, I'm using VS C++.NEW 2005 Express with clr:/pure syntax. I
submitted this as a bug report, link below:
http://lab.msdn.microsoft.com/produ...edbackid=ef3c8d9e-75e2-4916-87ee-640a4de75f39
Source below:
// Test_Compiler.cpp : main project file.
#include "stdafx.h"
using namespace System;
value struct Test_Struct
{
long x ;
} ;
ref class My_Class
{
public:
My_Class() {}
~My_Class() {}
private:
void Test_Compiler()
{
Test_Struct info ;
Test_Method( info ) ; // shouldn't compile, but does!!!
Test_Method( %info ) ; // ok
}
void Test_Method( Test_Struct^ info ) {}
} ;
int main(array<System::String ^> ^args)
{
return 0 ;
}
[==P==]