B
Ben Voigt
This smells like a bug to me, since literals are substituted at compile
time. I'm using VS2005 SP1 beta.
// literal_unmanaged.cpp : main project file.
ref class TheClass
{
literal int ExitCode = 0;
};
#pragma unmanaged
int main()
{
return TheClass::ExitCode;
}
1>------ Build started: Project: literal_unmanaged, Configuration: Debug
Win32 ------
1>Compiling...
1>literal_unmanaged.cpp
1>.\literal_unmanaged.cpp(12) : error C3821: 'TheClass': managed type or
function cannot be used in an unmanaged function
time. I'm using VS2005 SP1 beta.
// literal_unmanaged.cpp : main project file.
ref class TheClass
{
literal int ExitCode = 0;
};
#pragma unmanaged
int main()
{
return TheClass::ExitCode;
}
1>------ Build started: Project: literal_unmanaged, Configuration: Debug
Win32 ------
1>Compiling...
1>literal_unmanaged.cpp
1>.\literal_unmanaged.cpp(12) : error C3821: 'TheClass': managed type or
function cannot be used in an unmanaged function