tqdm.cpp icon indicating copy to clipboard operation
tqdm.cpp copied to clipboard

Drops 'const' qualifier

Open amallia opened this issue 7 years ago • 3 comments

Getting the following error:

/Users/amallia/Development/sera/external/tqdm.cpp/include/tqdm/utils.h:106:12: error: binding value of type 'const std::__1::iterator<std::__1::forward_iterator_tag, ds2i::binary_freq_collection::sequence, long,
      ds2i::binary_freq_collection::sequence *, ds2i::binary_freq_collection::sequence &>::value_type' (aka 'const ds2i::binary_freq_collection::sequence') to reference to type
      'tqdm::MyIteratorWrapper<ds2i::binary_freq_collection::iterator>::value_type' (aka 'ds2i::binary_freq_collection::sequence') drops 'const' qualifier
    return *p;
           ^~
/Users/amallia/Development/sera/src/create_freq_index.cpp:69:23: note: in instantiation of member function 'tqdm::MyIteratorWrapper<ds2i::binary_freq_collection::iterator>::operator*' requested here
    for (auto &&plist : tqdm::tqdm(input)) {

amallia avatar Aug 18 '18 20:08 amallia

if you remove tqdm::tqdm from the last line (leaving input unwrapped) does it work?

casperdcl avatar Aug 19 '18 08:08 casperdcl

Yes. Of course

amallia avatar Aug 19 '18 08:08 amallia

This is the iterator:

        class iterator : public std::iterator<std::forward_iterator_tag,
                                              sequence> {

if I change it like this it works:

        class iterator : public std::iterator<std::forward_iterator_tag,
                                              const sequence> {

But i feel there is also a bug in tqdm

amallia avatar Aug 19 '18 08:08 amallia