X-Git-Url: http://plrg.eecs.uci.edu/git/?a=blobdiff_plain;f=folly%2Ftest%2Fsorted_vector_test.cpp;h=2c7160ea4e426ec049319779dd74cac9fd3815c6;hb=43d3a315bbd54cb187021897b566ffb53290a44b;hp=e1366787ab00a4df74b5a71d17259f47c8b9a51e;hpb=e9e3d9b685715f91ec9527e11723e85fcee2a85e;p=folly.git diff --git a/folly/test/sorted_vector_test.cpp b/folly/test/sorted_vector_test.cpp index e1366787..2c7160ea 100644 --- a/folly/test/sorted_vector_test.cpp +++ b/folly/test/sorted_vector_test.cpp @@ -1,5 +1,5 @@ /* - * 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. @@ -15,16 +15,19 @@ */ #include -#include + #include +#include + +#include using folly::sorted_vector_set; using folly::sorted_vector_map; namespace { -template -struct less_invert : std::binary_function { +template +struct less_invert { bool operator()(const T& a, const T& b) const { return b < a; } @@ -336,3 +339,11 @@ TEST(SortedVectorTest, ShrinkTest) { // vector::shrink_to_fit respects the caller. EXPECT_EQ(s.capacity(), s.size()); } + +TEST(SortedVectorTypes, EraseTest) { + sorted_vector_set s1; + s1.insert(1); + sorted_vector_set s2(s1); + EXPECT_EQ(0, s1.erase(0)); + EXPECT_EQ(s2, s1); +}