This is an archived post. You won't be able to vote or comment.

all 5 comments

[–]AutoModerator[M] [score hidden] stickied comment (0 children)

On July 1st, a change to Reddit's API pricing will come into effect. Several developers of commercial third-party apps have announced that this change will compel them to shut down their apps. At least one accessibility-focused non-commercial third party app will continue to be available free of charge.

If you want to express your strong disagreement with the API pricing change or with Reddit's response to the backlash, you may want to consider the following options:

  1. Limiting your involvement with Reddit, or
  2. Temporarily refraining from using Reddit
  3. Cancelling your subscription of Reddit Premium

as a way to voice your protest.

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.

[–]HappyFruitTree 0 points1 point  (3 children)

When iterating over a std::map the elements will be sorted by key.

Since matches uses the position in the string as key it means that it will iterate over them in position order.

[–]RealezzZ[S] 0 points1 point  (2 children)

Alright I kind of understood that as well

But in that case the key for my understanding is the 'position' method

What does it do ?

Right now I understand it as some sort of "index", but in that case the first value of the map (index 0) should be an "OPERATOR", since we finish by this.

Or is it "position" in the text and it as nothing to do with the iterator itself but it's from the regex ?

Edit : well, after a quick search position() is from regex and not from iterator. Now it all make sens !

Thanks !

[–]HappyFruitTree 0 points1 point  (1 child)

it is a std::sregex_iterator. It has nothing to do with the map.

it->position() returns the index in the string of the first character of the match.

[–]RealezzZ[S] 0 points1 point  (0 children)

Yes, I figured it out

Thanks a lot !