[glibmm] ustring: Add cbegin() and cend().



commit 1cce397af6d1c9dd588d4a16e2b33933bb30d2ea
Author: Murray Cumming <murrayc murrayc com>
Date:   Tue Nov 8 10:21:15 2016 +0100

    ustring: Add cbegin() and cend().
    
    As in std::string since C++11.

 glib/glibmm/ustring.cc |   12 ++++++++++++
 glib/glibmm/ustring.h  |   10 ++++++++++
 2 files changed, 22 insertions(+), 0 deletions(-)
---
diff --git a/glib/glibmm/ustring.cc b/glib/glibmm/ustring.cc
index 15ab009..eae9802 100644
--- a/glib/glibmm/ustring.cc
+++ b/glib/glibmm/ustring.cc
@@ -841,6 +841,18 @@ ustring::rend() const
   return const_reverse_iterator(const_iterator(string_.begin()));
 }
 
+ustring::const_iterator
+ustring::cbegin() const
+{
+  return const_iterator(string_.begin());
+}
+
+ustring::const_iterator
+ustring::cend() const
+{
+  return const_iterator(string_.end());
+}
+
 /**** Glib::ustring::find() ************************************************/
 
 ustring::size_type
diff --git a/glib/glibmm/ustring.h b/glib/glibmm/ustring.h
index 8e8a546..fe45c1a 100644
--- a/glib/glibmm/ustring.h
+++ b/glib/glibmm/ustring.h
@@ -469,6 +469,16 @@ public:
   const_reverse_iterator rbegin() const;
   const_reverse_iterator rend() const;
 
+  /**
+   * @newin{2,52}
+   */
+  const_iterator cbegin() const;
+
+  /**
+   * @newin{2,52}
+   */
+  const_iterator cend() const;
+
   //! @}
   //! @name Find sub-strings.
   //! @{


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]