Overloading member methods with typedef aliases as parameters

后端 未结 3 397
我寻月下人不归
我寻月下人不归 2021-01-19 12:49

I’m having some trouble overloading methods in C++.

typedef char int8_t;
class SomeClass{
public:
…
void Method(int8_t paramater);
void Method(char paramater         


        
3条回答
  •  逝去的感伤
    2021-01-19 13:31

    Use a faux type. Wrap one of char or int8_t in a structure and use the structure as a parameter.

提交回复
热议问题