int x = (Int32) thisisObjectType is boxing, if the type is already checked ?
Managed C++/CLI
2
Posts
2
Posters
0
Views
1
Watching
-
int x = (Int32) thisisObjectType is boxing, if the type is already checked ?
if (thisisObjectType->GetType() == Int32::typeid) // declaration of thisisObjectType would be… Object^ thisisObjectType
{
int x = (Int32) thisisObjectType; // will this be considered as boxing ? should this be replaced with TryParse ?
} -
int x = (Int32) thisisObjectType is boxing, if the type is already checked ?
if (thisisObjectType->GetType() == Int32::typeid) // declaration of thisisObjectType would be… Object^ thisisObjectType
{
int x = (Int32) thisisObjectType; // will this be considered as boxing ? should this be replaced with TryParse ?
}Why would you use
TryParse()
if it's already an integer, and why would you need a cast?