我无法解决的C ++长错误消息

时间:2018-07-27 07:54:50

标签: c++ clion

enter image description here

我收到此消息,并且持续了很长时间,我不知道为什么。 它说模板使用可能有问题,但我不认为我做错了什么:

using std::shared_ptr;
using std::set;

class User{
    set<CoinBalance> holdings;
    ApiConnection api;

public:
    void newHolding(const shared_ptr<Coin>&, double amount = 0);
    void addToHolding(const shared_ptr<Coin>&, double amount = 0);
    void decreaseFromHolding(const shared_ptr<Coin>&, double amount = 0);

    double getHondingsUsdValue();
};

这就是我使用shared_ptr的方式:

class CoinBalance {
    shared_ptr<Coin> coin;
    double amount;
};

2 个答案:

答案 0 :(得分:1)

是的,您需要实现

答案 1 :(得分:0)

我认为您必须为类CoinBalance实现运算符'<'。

相关问题