[llvm-commits] [llvm] r93294 - /llvm/trunk/include/llvm/ADT/StringRef.h
Chris Lattner
sabre at nondot.org
Tue Jan 12 20:50:21 PST 2010
Author: lattner
Date: Tue Jan 12 22:50:20 2010
New Revision: 93294
URL: http://llvm.org/viewvc/llvm-project?rev=93294&view=rev
Log:
give StringRef a const_iterator member.
Modified:
llvm/trunk/include/llvm/ADT/StringRef.h
Modified: llvm/trunk/include/llvm/ADT/StringRef.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ADT/StringRef.h?rev=93294&r1=93293&r2=93294&view=diff
==============================================================================
--- llvm/trunk/include/llvm/ADT/StringRef.h (original)
+++ llvm/trunk/include/llvm/ADT/StringRef.h Tue Jan 12 22:50:20 2010
@@ -29,6 +29,7 @@
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 @@
// 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
More information about the llvm-commits
mailing list