Author Topic: STL class member or standard C++ keyword?  (Read 11158 times)

stefanos_

  • Guest
STL class member or standard C++ keyword?
« on: June 10, 2013, 04:17:35 pm »
I have got confused with the following output.

If I start typing for example, "std::vector::ite...", the auto completion mechanism will display "iterator" as part of vector class.

std::vector::iterator

If I start typing "std::vector<int>::iter...", the auto completion will display "iterator" as part of C++ keyword list.

std::vector<int>::iterator

Is this how it supposed to work? I got confused :S

P.S.: Is there a reason why "img" does not work with pasteboard.co (and I had to use "url") or is it because forums need upgrade to the latest version of SMF that could have fixed this issue?
« Last Edit: June 10, 2013, 04:23:31 pm by ToApolytoXaos »

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5358
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: STL class member or standard C++ keyword?
« Reply #1 on: June 10, 2013, 04:45:54 pm »
Quote
P.S.: Is there a reason why "img" does not work with pasteboard.co (and I had to use "url") or is it because forums need upgrade to the latest version of SMF that could have fixed this issue?
I think the site (pasteboard.co) does no allow an external link/access to the image. Our forum does not have the issue.

Quote
I have got confused with the following output.

If I start typing for example, "std::vector::ite...", the auto completion mechanism will display "iterator" as part of vector class.

std::vector::iterator

If I start typing "std::vector<int>::iter...", the auto completion will display "iterator" as part of C++ keyword list.

std::vector<int>::iterator

Is this how it supposed to work? I got confused :S
I think:
In the first case, "iterator" is a member of std::vector, so it show it correctly.
In the second case, the parser failed to parse the statement "std::vector<int>::iter", so as a fullback, it shows some C++ keyword, which contains a C++ keyword named "iterator".
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

stefanos_

  • Guest
Re: STL class member or standard C++ keyword?
« Reply #2 on: June 12, 2013, 07:05:00 pm »
Another question I would like to ask if I may. With NetBeans, I hover on a keyword and press Ctrl key and that keyword becomes a symbolic link to the original location of that keyword; if it's class String, it would take me to the actual location of that class file and so forth.

Is it difficult to implement the same logic more or less for Code::Blocks? If yes, which part of project should I look at so I would experiment a bit?

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13393
    • Travis build status
Re: STL class member or standard C++ keyword?
« Reply #3 on: June 12, 2013, 08:23:20 pm »
Is it difficult to implement the same logic more or less for Code::Blocks? If yes, which part of project should I look at so I would experiment a bit?
Ctrl-shift+. or Ctrl-. does almost the same thing.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]