summaryrefslogtreecommitdiff
path: root/core/fxcrt/cfx_string_c_template.h
diff options
context:
space:
mode:
Diffstat (limited to 'core/fxcrt/cfx_string_c_template.h')
-rw-r--r--core/fxcrt/cfx_string_c_template.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/core/fxcrt/cfx_string_c_template.h b/core/fxcrt/cfx_string_c_template.h
index b0e17a1222..9123fc234b 100644
--- a/core/fxcrt/cfx_string_c_template.h
+++ b/core/fxcrt/cfx_string_c_template.h
@@ -8,6 +8,7 @@
#define CORE_FXCRT_CFX_STRING_C_TEMPLATE_H_
#include <algorithm>
+#include <iterator>
#include <type_traits>
#include <utility>
#include <vector>
@@ -26,6 +27,7 @@ class CFX_StringCTemplate {
using CharType = T;
using UnsignedType = typename std::make_unsigned<CharType>::type;
using const_iterator = const CharType*;
+ using const_reverse_iterator = std::reverse_iterator<const_iterator>;
CFX_StringCTemplate() : m_Ptr(nullptr), m_Length(0) {}
@@ -84,6 +86,13 @@ class CFX_StringCTemplate {
: nullptr;
}
+ const_reverse_iterator rbegin() const {
+ return const_reverse_iterator(end());
+ }
+ const_reverse_iterator rend() const {
+ return const_reverse_iterator(begin());
+ }
+
bool operator==(const CharType* ptr) const {
return FXSYS_len(ptr) == m_Length &&
FXSYS_cmp(ptr, reinterpret_cast<const CharType*>(m_Ptr.Get()),