実際に地獄です。誰かが以下のセグメントがうまくいかない理由を簡単に説明できますか?C++リターン型修飾子天国
class Hey;
class Bitmap {
public:
const Hey* const& getHey() { return hey; }; // works
const Hey* & getHey2() { return hey; }; // error C2440: 'return' : cannot convert from 'Hey *' to 'const Hey *&'
private:
Hey* hey;
};
あなたが話すこの「公平」とは何ですか? –
何がフェアですか?ねえ? – Lundin
シンプルな 'const Hey *'を返すと何が問題になるのですか?何を参照する必要がありますか? – trojanfoe