我遇到了这样的语法:
class Wrapper
{
static const char * libname;
public:
Wrapper(void);
static int (__stdcall *myfunction)(int val1, int val1, char val3);
}myfunction来自一个C库,在头文件中有这个签名:
int __stdcall myfunction(int val1, int val1, char val3);现在,当从包装器类调用此函数时...
Wrapper::myfunction(1,2, 3);...I希望能够为参数定义标准值,这样我也可以使用更少的参数或不使用参数来调用它。但我不确定在哪里定义它们。在包装器类中,我得到了这个错误:
error C2383: 'Wrapper::myfunction' : default-arguments are not allowed on this symbol我真的需要一些帮助。谢谢!
发布于 2013-10-18 21:19:49
按以下方式在类内定义静态函数成员
static int __stdcall myfunction(int val1 = 1, int val2 = 2, char val3 = 3)
{
return ::myfunction( val1, val2, val3 );
}https://stackoverflow.com/questions/19450553
复制相似问题