[SERVER-10248] StringData should have a const_iterator type and begin() and end() methods. Created: 18/Jul/13  Updated: 11/Jul/16  Resolved: 22/Aug/13

Status: Closed
Project: Core Server
Component/s: Internal Code
Affects Version/s: None
Fix Version/s: 2.5.2

Type: Improvement Priority: Trivial - P5
Reporter: Andy Schwerin Assignee: Andrew Morrow (Inactive)
Resolution: Done Votes: 1
Labels: neweng, pull-request
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Backwards Compatibility: Fully Compatible
Participants:

 Description   

This would make it compatible with various standard algorithms and programming practices already common in the codebase.

Proposed implementation:

class StringData {
public:
typedef const char* const_iterator;
...
const_iterator begin()

{ return rawData(); }

const_iterator end()

{ return rawData() + size(); }

...
};



 Comments   
Comment by Andrew Morrow (Inactive) [ 22/Aug/13 ]

Pull request was merged.

Comment by Eric Daniels (Inactive) [ 23/Jul/13 ]

Pull Request:
https://github.com/mongodb/mongo/pull/459

Generated at Thu Feb 08 03:22:41 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.