Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Drops 'const' qualifier #48

Open
amallia opened this issue Aug 18, 2018 · 3 comments
Open

Drops 'const' qualifier #48

amallia opened this issue Aug 18, 2018 · 3 comments

Comments

@amallia
Copy link
Contributor

amallia commented Aug 18, 2018

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)) {
@casperdcl
Copy link
Sponsor Member

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

@amallia
Copy link
Contributor Author

amallia commented Aug 19, 2018

Yes. Of course

@amallia
Copy link
Contributor Author

amallia commented Aug 19, 2018

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants