C++/CLI - syntax for referencing static method from certain namespace
I want to execute a static method from certain class in certain namespace, but I have a problem with using it as a method parameter.
Example:
Lets say there is a class:
namespace ExampleNamespace {
public ref class A
{
public:
static int MethodA();
};
}
And I want to use MethodA in oth开发者_JAVA技巧er namespace as a other's method parameter:
MethodB(MethodA());
Only way I can make it work is by writing it like this:
ExampleNamespace::A^ a;
MethodB(a->MethodA());
Is there a way to write it without that 'a' declaration before? Something like
MethodB(ExampleNamespace::A->MethodA())
wont work...
Thank you in advance.
MethodB(ExampleNamespace::A::MethodA());
精彩评论