I
Ioannis Vranos
This compiles:
value class SomeClass
{};
int main()
{
SomeClass obj;
SomeClass *p= &obj;
}
C:\c>cl /clr temp.cpp
Microsoft (R) C/C++ Optimizing Compiler Version 14.00.41013
for Microsoft (R) .NET Framework version 2.00.41013.0
Copyright (C) Microsoft Corporation. All rights reserved.
temp.cpp
Microsoft (R) Incremental Linker Version 8.00.41013
Copyright (C) Microsoft Corporation. All rights reserved.
/out:temp.exe
temp.obj
C:\c>
Also this compiles:
value class SomeClass
{};
int main()
{
SomeClass obj;
pin_ptr<SomeClass> p= &obj;
}
C:\c>cl /clr temp.cpp
Microsoft (R) C/C++ Optimizing Compiler Version 14.00.41013
for Microsoft (R) .NET Framework version 2.00.41013.0
Copyright (C) Microsoft Corporation. All rights reserved.
temp.cpp
Microsoft (R) Incremental Linker Version 8.00.41013
Copyright (C) Microsoft Corporation. All rights reserved.
/out:temp.exe
temp.obj
C:\c>
Can we get a regular pointer to a value object? Value types can not be
moved from the CLR?
value class SomeClass
{};
int main()
{
SomeClass obj;
SomeClass *p= &obj;
}
C:\c>cl /clr temp.cpp
Microsoft (R) C/C++ Optimizing Compiler Version 14.00.41013
for Microsoft (R) .NET Framework version 2.00.41013.0
Copyright (C) Microsoft Corporation. All rights reserved.
temp.cpp
Microsoft (R) Incremental Linker Version 8.00.41013
Copyright (C) Microsoft Corporation. All rights reserved.
/out:temp.exe
temp.obj
C:\c>
Also this compiles:
value class SomeClass
{};
int main()
{
SomeClass obj;
pin_ptr<SomeClass> p= &obj;
}
C:\c>cl /clr temp.cpp
Microsoft (R) C/C++ Optimizing Compiler Version 14.00.41013
for Microsoft (R) .NET Framework version 2.00.41013.0
Copyright (C) Microsoft Corporation. All rights reserved.
temp.cpp
Microsoft (R) Incremental Linker Version 8.00.41013
Copyright (C) Microsoft Corporation. All rights reserved.
/out:temp.exe
temp.obj
C:\c>
Can we get a regular pointer to a value object? Value types can not be
moved from the CLR?