| 41 | /// \see \ref vector "vector<T>" |
| 42 | template<class CharT, class Traits = std::char_traits<CharT> > |
| 43 | class basic_string |
| 44 | { |
| 45 | public: |
| 46 | typedef Traits traits_type; |
| 47 | typedef typename Traits::char_type value_type; |
| 48 | typedef size_t size_type; |
| 49 | static const size_type npos = size_type(-1); |
| 50 | typedef typename ::boost::compute::vector<CharT>::reference reference; |
| 51 | typedef typename ::boost::compute::vector<CharT>::const_reference const_reference; |
| 52 | typedef typename ::boost::compute::vector<CharT>::iterator iterator; |
| 53 | typedef typename ::boost::compute::vector<CharT>::const_iterator const_iterator; |
| 54 | typedef typename ::boost::compute::vector<CharT>::reverse_iterator reverse_iterator; |
| 55 | typedef typename ::boost::compute::vector<CharT>::const_reverse_iterator const_reverse_iterator; |
| 56 | |
| 57 | basic_string() |
| 58 | { |
| 59 | } |
| 60 | |
| 61 | basic_string(size_type count, CharT ch) |
| 62 | : m_data(count) |
| 63 | { |
| 64 | std::fill(m_data.begin(), m_data.end(), ch); |
| 65 | } |
| 66 | |
| 67 | basic_string(const basic_string &other, |
| 68 | size_type pos, |
| 69 | size_type count = npos) |
| 70 | : m_data(other.begin() + pos, |
| 71 | other.begin() + (std::min)(other.size(), count)) |
| 72 | { |
| 73 | } |
| 74 | |
| 75 | basic_string(const char *s, size_type count) |
| 76 | : m_data(s, s + count) |
| 77 | { |
| 78 | } |
| 79 | |
| 80 | basic_string(const char *s) |
| 81 | : m_data(s, s + std::strlen(s)) |
| 82 | { |
| 83 | } |
| 84 | |
| 85 | template<class InputIterator> |
| 86 | basic_string(InputIterator first, InputIterator last) |
| 87 | : m_data(first, last) |
| 88 | { |
| 89 | } |
| 90 | |
| 91 | basic_string(const basic_string<CharT, Traits> &other) |
| 92 | : m_data(other.m_data) |
| 93 | { |
| 94 | } |
| 95 | |
| 96 | basic_string<CharT, Traits>& operator=(const basic_string<CharT, Traits> &other) |
| 97 | { |
| 98 | if(this != &other){ |
| 99 | m_data = other.m_data; |
| 100 | } |
nothing calls this directly
no outgoing calls
no test coverage detected