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

Does not compile Ubuntu #12

Open
GoogleCodeExporter opened this issue Mar 18, 2016 · 1 comment
Open

Does not compile Ubuntu #12

GoogleCodeExporter opened this issue Mar 18, 2016 · 1 comment

Comments

@GoogleCodeExporter
Copy link

What steps will reproduce the problem?
auto range = duplicates.equal_range(query_ids_temp[i]);
        for (auto it = range.first; it != range.second; ++it) {
            std::vector<unsigned int>::iterator pos = std::find(deleted_queries.begin(), deleted_queries.end(), it->second);
            if (pos != deleted_queries.end()) {
                duplicates.erase(it);
                deleted_queries.erase(pos);

            } else {
                query_ids.push_back(it->second);
            }
        } 

The error seems to be the it->second

What is the expected output? What do you see instead?
In file included from ref_impl/../include/btree_map.h:31:0,
                 from ref_impl/core.cpp:48:
ref_impl/../include/btree.h: In instantiation of 
‘btree::btree_node<Params>::reference btree::btree_node<Params>::value(int) 
[with Params = btree::btree_map_params<unsigned int, unsigned int, 
std::less<unsigned int>, std::allocator<std::pair<const unsigned int, unsigned 
int> >, 256>; btree::btree_node<Params>::reference = std::pair<const unsigned 
int, unsigned int>&]’:
ref_impl/../include/btree.h:809:33:   required from 
‘btree::btree_iterator<Node, Reference, Pointer>::pointer 
btree::btree_iterator<Node, Reference, Pointer>::operator->() const [with Node 
= btree::btree_node<btree::btree_map_params<unsigned int, unsigned int, 
std::less<unsigned int>, std::allocator<std::pair<const unsigned int, unsigned 
int> >, 256> >; Reference = std::pair<const unsigned int, unsigned int>&; 
Pointer = std::pair<const unsigned int, unsigned int>*; 
btree::btree_iterator<Node, Reference, Pointer>::pointer = std::pair<const 
unsigned int, unsigned int>*]’
ref_impl/core.cpp:539:106:   required from here

What version of the product are you using? On what operating system?
Version 1.0.1,
Ubuntu 12.04

Please provide any additional information below.

Original issue reported on code.google.com by nteni...@gmail.com on 21 Mar 2013 at 3:16

@GoogleCodeExporter
Copy link
Author

Here is the code without auto to make it more readable:

for (btree_multimap<unsigned int, unsigned int>::iterator it = range.first; it 
!= range.second; ++it) {
            auto temp = it->second;
            std::vector<unsigned int>::iterator position = std::find(deleted_queries.begin(), deleted_queries.end(), temp);
            if (position != deleted_queries.end()) {
                duplicates.erase(temp);
                deleted_queries.erase(position);

            } else {
                query_ids.push_back(it->second);
            }
        }

Please keep in mind that the error seems to be at auto temp = it->second;

Original comment by nteni...@gmail.com on 21 Mar 2013 at 3:19

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

No branches or pull requests

1 participant