diff options
author | Chris Lattner <sabre@nondot.org> | 2010-01-13 04:50:20 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2010-01-13 04:50:20 +0000 |
commit | af2a8361e4e5b45441b6e73c332fb60c36892468 (patch) | |
tree | b868b8d2a7e0fc947f2ebe0a6fe158f3ef8d49f6 /include/llvm/ADT/StringRef.h | |
parent | 38c2b0a99c6a3f5cdf6ef5a46e4a6826b30acbfb (diff) | |
download | external_llvm-af2a8361e4e5b45441b6e73c332fb60c36892468.tar.gz external_llvm-af2a8361e4e5b45441b6e73c332fb60c36892468.tar.bz2 external_llvm-af2a8361e4e5b45441b6e73c332fb60c36892468.zip |
give StringRef a const_iterator member.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93294 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/ADT/StringRef.h')
-rw-r--r-- | include/llvm/ADT/StringRef.h | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/include/llvm/ADT/StringRef.h b/include/llvm/ADT/StringRef.h index 14efb824a8..3064af3abb 100644 --- a/include/llvm/ADT/StringRef.h +++ b/include/llvm/ADT/StringRef.h @@ -29,6 +29,7 @@ namespace llvm { class StringRef { public: typedef const char *iterator; + typedef const char *const_iterator; static const size_t npos = ~size_t(0); typedef size_t size_type; @@ -42,15 +43,8 @@ namespace llvm { // Workaround PR5482: nearly all gcc 4.x miscompile StringRef and std::min() // Changing the arg of min to be an integer, instead of a reference to an // integer works around this bug. - size_t min(size_t a, size_t b) const - { - return a < b ? a : b; - } - - size_t max(size_t a, size_t b) const - { - return a > b ? a : b; - } + size_t min(size_t a, size_t b) const { return a < b ? a : b; } + size_t max(size_t a, size_t b) const { return a > b ? a : b; } public: /// @name Constructors |