Changeset 17:1b2e312c7b52 in rrlib_uri
- Timestamp:
- 10.02.2021 21:23:51 (2 years ago)
- Branch:
- 17.03
- Children:
- 18:a5dd51c346e0, 19:49b39ac77cad
- Phase:
- public
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
tPath.h
r13 r17 305 305 306 306 tConstIterator(const tPath& path, size_t element_index) : 307 path( path),307 path(&path), 308 308 element_index(element_index), 309 309 element() … … 314 314 friend bool operator==(const tConstIterator& lhs, const tConstIterator& rhs) 315 315 { 316 return ( &lhs.path == &rhs.path) && lhs.element_index == rhs.element_index;316 return (*lhs.path == *rhs.path) && lhs.element_index == rhs.element_index; 317 317 } 318 318 friend bool operator!=(const tConstIterator& lhs, const tConstIterator& rhs) … … 350 350 friend tConstIterator operator+(const tConstIterator& lhs, size_t rhs) 351 351 { 352 return tConstIterator( lhs.path, lhs.element_index + rhs);352 return tConstIterator(*lhs.path, lhs.element_index + rhs); 353 353 } 354 354 friend tConstIterator operator-(const tConstIterator& lhs, size_t rhs) 355 355 { 356 return tConstIterator( lhs.path, lhs.element_index - rhs);356 return tConstIterator(*lhs.path, lhs.element_index - rhs); 357 357 } 358 358 359 359 private: 360 360 361 const tPath &path;361 const tPath* path; 362 362 size_t element_index; 363 363 tElement element; … … 365 365 void UpdateElement() 366 366 { 367 element = element_index >= path .element_count ? tStringRange() : path[element_index];367 element = element_index >= path->element_count ? tStringRange() : (*path)[element_index]; 368 368 } 369 369 };
Note: See TracChangeset
for help on using the changeset viewer.