diff options
author | Lei Zhang <thestig@chromium.org> | 2015-12-22 14:57:45 -0800 |
---|---|---|
committer | Lei Zhang <thestig@chromium.org> | 2015-12-22 14:57:45 -0800 |
commit | 9ba6a147311eacb933c175168de6d11c439985d3 (patch) | |
tree | a1a75ac52168294f73b6eda5c65c26e4444b4c47 /third_party/base/stl_util.h | |
parent | cd2bb30aba89a05c0bbd4d6973fa070205e3a1e8 (diff) | |
download | pdfium-9ba6a147311eacb933c175168de6d11c439985d3.tar.xz |
Merge to XFA: Start using allowed C++11 features.
TBR=dml@google.com, thakis@chromium.org
Review URL: https://codereview.chromium.org/1544923002 .
Review URL: https://codereview.chromium.org/1545823002 .
(cherry picked from commit ba2586d2c0a50df14aa2549a0a841e1d4b9af4b6)
(cherry picked from commit 87f7d29531dabfd66e547a6be31a08272ff631d5)
Review URL: https://codereview.chromium.org/1542213002 .
Diffstat (limited to 'third_party/base/stl_util.h')
-rw-r--r-- | third_party/base/stl_util.h | 15 |
1 files changed, 0 insertions, 15 deletions
diff --git a/third_party/base/stl_util.h b/third_party/base/stl_util.h index 50e9341569..32656038c1 100644 --- a/third_party/base/stl_util.h +++ b/third_party/base/stl_util.h @@ -5,23 +5,8 @@ #ifndef PDFIUM_THIRD_PARTY_BASE_STL_UTIL_H_ #define PDFIUM_THIRD_PARTY_BASE_STL_UTIL_H_ -#include <vector> - namespace pdfium { -// To treat a possibly-empty vector as an array, use these functions. -// If you know the array will never be empty, you can use &*v.begin() -// directly, but that is undefined behaviour if |v| is empty. -template <typename T> -inline T* vector_as_array(std::vector<T>* v) { - return v->empty() ? nullptr : &*v->begin(); -} - -template <typename T> -inline const T* vector_as_array(const std::vector<T>* v) { - return v->empty() ? nullptr : &*v->begin(); -} - // Test to see if a set, map, hash_set or hash_map contains a particular key. // Returns true if the key is in the collection. template <typename Collection, typename Key> |