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 6606489
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T19:24:05+00:00 2026-05-25T19:24:05+00:00

Lets say that I have got a vector like this. std::vector<a_complicated_whatever_identifier *> *something =

  • 0

Lets say that I have got a vector like this.

std::vector<a_complicated_whatever_identifier *> *something
    = new std::vector<a_complicated_whatever_identifier *>;
// by the way, is this the right way to do this?

Now I want to get an iterator for this… so I would do this like this.

std::vector<a_complicated_whatever_identifier *>::iterator iter;

But I find it a little too much for my code. I wonder, is there any more, brief way to ask for an iterator regardless of the type?

I was thinking in something like.

something::iterator iter;
    // OK, don’t laugh at me, I am still beginning with C++

Well, it obviously fail, but I guess you get the idea. How to accomplish this or something similar?

  • 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-05-25T19:24:05+00:00Added an answer on May 25, 2026 at 7:24 pm

    Use a typedef.

    typedef std::vector<complicated *>::iterator complicated_iter
    

    Then set them like this:

    complicated_iter begin, end;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Lets say we have got rows like that: MyTable ID Name Product ------------------ 1
lets say that I've got this XML: <items> <item name=thumb> <downloadStream>test1</downloadStream> <downloadStream>test2</downloadStream> <downloadStream>test3</downloadStream> </item>
Lets say that you have websites www.xyz.com and www.abc.com. Lets say that a user
Lets say that I have a header user control in a master page, and
Lets say you have interface definition. That interface can be Operation . Then you
I have one field that I need to sum lets say named items However
Using Rails v2.1, lets say you have an action for a controller that is
Let's say I have a fairly simple app that lets users store information on
To use as an example: lets say that I have 2 EditText s and
Lets say that I've got the coordinates of two Rectangle s, they could be

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.