| 1 |
#ifndef INCLUDED_STRINGPTR_H_ |
| 2 |
#define INCLUDED_STRINGPTR_H_ |
| 3 |
|
| 4 |
#include <vector> |
| 5 |
#include <string> |
| 6 |
#include "iterator.h" |
| 7 |
|
| 8 |
class StringPtr: public std::vector<std::string *> |
| 9 |
{ |
| 10 |
public: |
| 11 |
using iterator = |
| 12 |
RandomPtrIterator |
| 13 |
< |
| 14 |
StringPtr, |
| 15 |
std::vector<std::string *>::iterator, |
| 16 |
std::string |
| 17 |
>; |
| 18 |
|
| 19 |
using reverse_iterator = std::reverse_iterator<iterator>; |
| 20 |
|
| 21 |
iterator begin(); |
| 22 |
iterator end(); |
| 23 |
reverse_iterator rbegin(); |
| 24 |
reverse_iterator rend(); |
| 25 |
}; |
| 26 |
|
| 27 |
inline StringPtr::iterator StringPtr::begin() |
| 28 |
{ |
| 29 |
return iterator(this->std::vector<std::string *>::begin() ); |
| 30 |
} |
| 31 |
inline StringPtr::iterator StringPtr::end() |
| 32 |
{ |
| 33 |
return iterator(this->std::vector<std::string *>::end()); |
| 34 |
} |
| 35 |
inline StringPtr::reverse_iterator StringPtr::rbegin() |
| 36 |
{ |
| 37 |
return reverse_iterator(end()); |
| 38 |
} |
| 39 |
inline StringPtr::reverse_iterator StringPtr::rend() |
| 40 |
{ |
| 41 |
return reverse_iterator(begin()); |
| 42 |
} |
| 43 |
#endif |