У меня эта ошибка при компиляции с g ++, но она того же типа, поэтому я не знаю, что делать:
error: cannot convert ‘IOperand*’ to ‘IOperand Factory:: *’ in return
68 | return (tmp->retOperand(type, value));
| ~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~
| |
| IOperand*
вот код:
IOperand Factory::*retOperand(eOperandType type, const std::string &value)
{
methodPtr_t mfPtr;
std::map<eOperandType, methodPtr_t>::iterator it;
return (NULL);
}
static IOperand Factory::*createOperand(eOperandType type, const std::string &value)
{
std::unique_ptr<Factory> tmp = std::make_unique<Factory>();
return (tmp->retOperand(type, value));
}
здесь это мой заголовок:
class Factory {
public:
Factory();
~Factory();
static IOperand *createOperand(eOperandType type, const std::string &value);
IOperand *retOperand(eOperandType type, const std::string &value);
protected:
private:
using methodPtr_t = IOperand *(Factory::*)(const std::string &);
IOperand *createInt8(const std::string &value);
IOperand *createInt16(const std::string &value);
IOperand *createInt32(const std::string &value);
IOperand *createFloat(const std::string &value);
IOperand *createDouble(const std::string &value);
IOperand *createBigDecimal(const std::string &value);
std::map<eOperandType, methodPtr_t> _methods;
};