两个班级 - >返回值

时间:2015-06-24 22:43:52

标签: c++ class return-value

我有2个类:Bucket和ExtHash

如何将函数的返回值从类Bucket分配给ExtHash类中的元素?为什么我的实施不起作用?

template <typename E, size_t N = 15> 
class Bucket
{
    size_t local; 
    size_t bucket_size;
. . .
 public:
E value1;
E value2;
...
E get_value1(){
return value1
}
E get_value2(){
return value2
}
....
};

template <typename E, size_t N = 15>
class ExtHash : public Container < E >
{
    size_t hash_size;
...
public:
...
virtual E function() const override;

};

template <typename E, size_t N>
E ExtHash<E, N>::function() const {
...
E last = Bucket<E, N>::get_value1(); //How should it look ???
E prev = Bucket<E, N>::get_value2);//How should it look????
...
}

0 个答案:

没有答案