FOLLY_ASSUME_FBVECTOR_COMPATIBLE_2(std::vector);
FOLLY_ASSUME_FBVECTOR_COMPATIBLE_2(std::list);
FOLLY_ASSUME_FBVECTOR_COMPATIBLE_2(std::deque);
-FOLLY_ASSUME_FBVECTOR_COMPATIBLE_4(std::map);
-FOLLY_ASSUME_FBVECTOR_COMPATIBLE_3(std::set);
FOLLY_ASSUME_FBVECTOR_COMPATIBLE_2(std::unique_ptr);
FOLLY_ASSUME_FBVECTOR_COMPATIBLE_1(std::shared_ptr);
FOLLY_ASSUME_FBVECTOR_COMPATIBLE_1(std::function);
#include <gtest/gtest.h>
#include <list>
+#include <map>
#include <memory>
#include <boost/random.hpp>
}
}
+TEST(FBVector, vector_of_maps) {
+ fbvector<std::map<std::string, std::string>> v;
+
+ v.push_back(std::map<std::string, std::string>());
+ v.push_back(std::map<std::string, std::string>());
+
+ EXPECT_EQ(2, v.size());
+
+ v[1]["hello"] = "world";
+ EXPECT_EQ(0, v[0].size());
+ EXPECT_EQ(1, v[1].size());
+
+ v[0]["foo"] = "bar";
+ EXPECT_EQ(1, v[0].size());
+ EXPECT_EQ(1, v[1].size());
+}
+
int main(int argc, char** argv) {
testing::InitGoogleTest(&argc, argv);
google::ParseCommandLineFlags(&argc, &argv, true);
EXPECT_TRUE (IsRelocatable<vector<F1>>::value);
EXPECT_FALSE((IsRelocatable<pair<F1, F1>>::value));
EXPECT_TRUE ((IsRelocatable<pair<T1, T2>>::value));
- EXPECT_TRUE (IsRelocatable<set<F1>>::value);
}
TEST(Traits, original) {