Closed nehcuh closed 4 years ago
Yeah, I don't see an issue with that. Can you show me a practical issue with an example?
I'm not quite sure if demo listed below is ok? I've modified from your test code vector_ptr_view_test.cc
. I've added some code after instantiation of VectorPtrView
which is variable vecview
,
VectorPtrView<int>::const_iterator item = vec_view.begin();
std::cout << *item << std::endl;
// std::cout << *(item++) << std::endl; // compilation error
std::cout << *(++item) << std::endl;
error: no viable conversion from 'hmdf::VectorPtrView<int>::iterator::iter_type' (aka '__wrap_iter<int **>') to
'hmdf::VectorPtrView<int>::iterator::value_type **' (aka 'int **')
value_type **ret_node = node_;
Thanks, your code snippet works fine. Do you mean this is not working
std::cout << *(item++) << std::endl;
I just pushed a fix to master
Got it! Thanks!
Hi Hosseinmoein,
Sorry to disturb again!
In your code
VectorPtrView.h
, you've definediterator
,const_iterator
andconst_reverse_iterator
, each class holds an constructor likeHowever, the method of
++
operation trys to convert aconst**
instead ofvalue_type*const*
toiterator
, is there's something wrong?