From 42a3dfb22cf5dbaba041c4905563038a77580459 Mon Sep 17 00:00:00 2001 From: Rui Ueyama Date: Wed, 8 Apr 2015 21:59:08 +0000 Subject: [PATCH] Add begin() and end() to atom_collection that returns non-const iterators. llvm-svn: 234445 --- lld/include/lld/Core/File.h | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/lld/include/lld/Core/File.h b/lld/include/lld/Core/File.h index 688b92d..4ac03a1 100644 --- a/lld/include/lld/Core/File.h +++ b/lld/include/lld/Core/File.h @@ -92,7 +92,10 @@ public: } template - using atom_iterator = typename std::vector::const_iterator; + using atom_iterator = typename std::vector::iterator; + + template + using const_atom_iterator = typename std::vector::const_iterator; /// \brief Different object file readers may instantiate and manage atoms with /// different data structures. This class is a collection abstraction. @@ -100,8 +103,10 @@ public: /// methods to enable clients to interate the File's atoms. template class atom_collection { public: - atom_iterator begin() const { return _atoms.begin(); } - atom_iterator end() const { return _atoms.end(); } + atom_iterator begin() { return _atoms.begin(); } + atom_iterator end() { return _atoms.end(); } + const_atom_iterator begin() const { return _atoms.begin(); } + const_atom_iterator end() const { return _atoms.end(); } uint64_t size() const { return _atoms.size(); } bool empty() const { return _atoms.empty(); } -- 2.7.4