Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8378579
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T15:57:40+00:00 2026-06-09T15:57:40+00:00

I am getting a lot of errors trying to use an iterator for three

  • 0

I am getting a lot of errors trying to use an iterator for three dimensional vector of sets of ints. See the following code (which is just select pieces, because the whole thing is too long; I think this should be enough to see what is wrong, but let me know if it isn’t):

vector<vector<vector<set<int> > > > particles_celllist;
vector<vector<vector<set<int> > > >::iterator cell_iter;
map<int,map<int,Particle> > particle_grid;

for (cell_iter=particles_celllist[wx][wy][wz].begin();cell_iter!=particles_celllist[wx][wy][wz].end();cell_iter++)
{
    double distance_to_cell=sqrt(pow(particles[*cell_iter].position().y()-(wy)*ygridlength,2)+
        pow(particles[*cell_iter].position().z()-(wz)*zgridlength,2));
    if (distance_to_cell<input_data.diam_large())
    {
        particle_grid[box_counter][*cell_iter]=particles[*cell_iter];
    }
}

Note: wx, wy, wz, and box_counter are ints, ygridlength and zgridlength are doubles, and Particle::position::y (or ::z) and input_data::diam_large return doubles.

I get a multitude of errors:

no match for operator “=” in
“cell_iter=particles_celllist[wx][wy][wz].begin()”

no match for operator “!=” in
“cell_iter!=particles_celllist[wx][wy][wz].end()”

no match for operator “[]” whenever I used [*cell_iter] to call
something

I get the feeling like the error somehow stems from the iterator itself, but I haven’t been able to figure it out.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T15:57:41+00:00Added an answer on June 9, 2026 at 3:57 pm

    You want set<int>::iterator cell_iter;. Just look again carefully at whose begin() function you’re calling.

    In C++11 you would of course just have said

    auto cell_iter = particles_celllist[wx][wy][wz].begin()
    

    and never noticed that this is hard 🙂

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm getting a lot of errors compiling code using the boost libraries, mainly when
I am getting a lot of gwt compile errors as follows in my playN
I am new to rails and getting stuck a lot trying to develop my
I'm having a lot of trouble getting my priority queue to recognize which parameter
I am trying to use Heroku and apparently Postgresql is a lot more strict
Been getting a lot of errors like this lately. I did some research and
We are trying to use Steven Sandersons Deleporter tool for cross process mocking: http://blog.stevensanderson.com/2010/03/09/deleporter-cross-process-code-injection-for-aspnet/
I´m getting this Cannot use typeid with -fno-rtti when I´m trying to compile my
I'm getting awful lot of spam to my forums where only registered users can
Having a lot of trouble getting texture maps to work in openGL ES (iphone).

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.