[llvm] r205542 - ArrayRef: use std::vector::data() now that we are building in C++11 mode
Dmitri Gribenko
gribozavr at gmail.com
Thu Apr 3 09:29:11 PDT 2014
Author: gribozavr
Date: Thu Apr 3 11:29:11 2014
New Revision: 205542
URL: http://llvm.org/viewvc/llvm-project?rev=205542&view=rev
Log:
ArrayRef: use std::vector::data() now that we are building in C++11 mode
Modified:
llvm/trunk/include/llvm/ADT/ArrayRef.h
Modified: llvm/trunk/include/llvm/ADT/ArrayRef.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ADT/ArrayRef.h?rev=205542&r1=205541&r2=205542&view=diff
==============================================================================
--- llvm/trunk/include/llvm/ADT/ArrayRef.h (original)
+++ llvm/trunk/include/llvm/ADT/ArrayRef.h Thu Apr 3 11:29:11 2014
@@ -77,7 +77,7 @@ namespace llvm {
/// Construct an ArrayRef from a std::vector.
template<typename A>
/*implicit*/ ArrayRef(const std::vector<T, A> &Vec)
- : Data(Vec.empty() ? (T*)0 : &Vec[0]), Length(Vec.size()) {}
+ : Data(Vec.data()), Length(Vec.size()) {}
/// Construct an ArrayRef from a C array.
template <size_t N>
More information about the llvm-commits
mailing list