/*
- * Copyright 2015 Facebook, Inc.
+ * Copyright 2016 Facebook, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
*/
#include <folly/sorted_vector_types.h>
-#include <gtest/gtest.h>
+
#include <list>
+#include <memory>
+
+#include <folly/portability/GTest.h>
using folly::sorted_vector_set;
using folly::sorted_vector_map;
namespace {
-template<class T>
-struct less_invert : std::binary_function<T,T,bool> {
+template <class T>
+struct less_invert {
bool operator()(const T& a, const T& b) const {
return b < a;
}
// vector::shrink_to_fit respects the caller.
EXPECT_EQ(s.capacity(), s.size());
}
+
+TEST(SortedVectorTypes, EraseTest) {
+ sorted_vector_set<int> s1;
+ s1.insert(1);
+ sorted_vector_set<int> s2(s1);
+ EXPECT_EQ(0, s1.erase(0));
+ EXPECT_EQ(s2, s1);
+}