- 241 名前:デフォルトの名無しさん mailto:sage [2009/03/21(土) 15:04:38 ]
- >237
> int& dereference() const const メンバ関数なので this は const step_iterator*。 従って、メンバの value も const int になります。 これは変更不可能なので、変更可能な参照 int& として返すことができません。 value を int* にした場合は、int * const になり、ポインタ値としては const ですが、 指している int の値は変更可能なので int& にできます。 > public boost::iterator_facade<step_iterator,int , boost::bidirectional_traversal_tag> > int& dereference() const ではなくて > public boost::iterator_facade<step_iterator,const int , boost::bidirectional_traversal_tag> > const int& dereference() const でどうでしょう?
|

|