Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(7)

Unified Diff: third_party/base/stl_util.h

Issue 1544923002: Start using allowed C++11 features. (Closed) Base URL: https://pdfium.googlesource.com/pdfium@master
Patch Set: Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/base/nonstd_unique_ptr_unittest.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/base/stl_util.h
diff --git a/third_party/base/stl_util.h b/third_party/base/stl_util.h
index 50e93415699cb395313b809a95b697016698f16a..32656038c145c2ba33a2c91edbd27afac4d8df09 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>
« no previous file with comments | « third_party/base/nonstd_unique_ptr_unittest.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698