From: Yedidya Feldblum Date: Wed, 24 Aug 2016 21:25:31 +0000 (-0700) Subject: Use cbegin and cend in static reflection container traits X-Git-Tag: v2016.08.29.00~15 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=aad1a0c5cb6c50d0770a3870d754e36e9684a9da;p=folly.git Use cbegin and cend in static reflection container traits Summary: [Thrift] Use `cbegin` and `cend` in static reflection container traits. These are functions that all the C++ standard library containers have. And add the two methods to `folly::sorted_vector_set` and `folly::sorted_vector_map`. Reviewed By: juchem Differential Revision: D3763187 fbshipit-source-id: 9d467a1cf391206eba671f454da428323c4a566a --- diff --git a/folly/sorted_vector_types.h b/folly/sorted_vector_types.h index 18540185..cc5c9c3c 100644 --- a/folly/sorted_vector_types.h +++ b/folly/sorted_vector_types.h @@ -229,7 +229,9 @@ public: iterator begin() { return m_.cont_.begin(); } iterator end() { return m_.cont_.end(); } + const_iterator cbegin() const { return m_.cont_.cbegin(); } const_iterator begin() const { return m_.cont_.begin(); } + const_iterator cend() const { return m_.cont_.cend(); } const_iterator end() const { return m_.cont_.end(); } reverse_iterator rbegin() { return m_.cont_.rbegin(); } reverse_iterator rend() { return m_.cont_.rend(); } @@ -470,7 +472,9 @@ public: iterator begin() { return m_.cont_.begin(); } iterator end() { return m_.cont_.end(); } + const_iterator cbegin() const { return m_.cont_.cbegin(); } const_iterator begin() const { return m_.cont_.begin(); } + const_iterator cend() const { return m_.cont_.cend(); } const_iterator end() const { return m_.cont_.end(); } reverse_iterator rbegin() { return m_.cont_.rbegin(); } reverse_iterator rend() { return m_.cont_.rend(); }