27 using namespace folly;
73 auto i1 = convertTo<int>(d1);
77 auto i2 = convertTo<int64_t>(d2);
81 auto i4 = convertTo<float>(
d4);
85 auto i5 = convertTo<bool>(
d5);
89 const auto i6 = convertTo<const int>(
d6);
93 auto i7 = convertTo<int>(d7);
97 auto i8 = convertTo<bool>(d8);
102 enum enum1 {
foo = 1,
bar = 2 };
105 auto i1 = convertTo<enum1>(d1);
109 auto i2 = convertTo<enum1>(d2);
112 enum class enum2 { FOO = 1, BAR = 2 };
115 auto i3 = convertTo<enum2>(
d3);
119 auto i4 = convertTo<enum2>(
d4);
125 auto i1 = convertTo<folly::fbstring>(d1);
129 auto i2 = convertTo<std::string>(d2);
133 auto i3 = convertTo<std::pair<int, std::string>>(
d3);
138 auto i4 = convertTo<std::pair<std::string, folly::fbstring>>(
d4);
145 auto i1 = convertTo<folly::fbvector<int>>(d1);
146 decltype(i1) i1b = {1, 2, 3};
152 auto i1 = convertTo<std::vector<int>>(d1);
153 decltype(i1) i1b = {1, 2, 3};
157 auto i2 = convertTo<std::set<int>>(d2);
158 decltype(i2) i2b = {1, 2, 3, 5, 4};
164 auto i1 = convertTo<std::map<int, std::string>>(d1);
165 decltype(i1) i1b = {{1,
"one"}, {2,
"two"}};
170 auto i2 = convertTo<std::unordered_map<int, std::string>>(d2);
171 decltype(i2) i2b = {{3,
"three"}, {4,
"four"}};
177 auto i1 = convertTo<std::map<std::string, std::string>>(d1);
178 decltype(i1) i1b = {{
"1",
"one"}, {
"2",
"two"}};
183 auto i2 = convertTo<std::unordered_map<std::string, std::string>>(d2);
184 decltype(i2) i2b = {{
"3",
"three"}, {
"4",
"four"}};
190 auto i1 = convertTo<std::vector<std::pair<std::string, std::string>>>(d1);
191 std::sort(i1.begin(), i1.end());
192 decltype(i1) i1b = {{
"1",
"one"}, {
"2",
"two"}};
199 auto i1 = convertTo<folly::fbvector<std::vector<uint8_t>>>(d1);
200 decltype(i1) i1b = {{1}, {}, {2, 3}};
206 auto i2 = convertTo<std::map<double, std::vector<folly::fbstring>>>(d2);
208 {3.14, {
"3",
".",
"1",
"4"}},
209 {2.72, {
"2",
".",
"7",
"2"}},
224 return {convertTo<int>(d[
"i"])};
230 auto i1 = convertTo<A>(d1);
235 auto i2 = convertTo<std::vector<A>>(d2);
236 decltype(i2) i2b = {{18}, {19}};
246 std::set<std::string> s1 = {
"a",
"e",
"i",
"o",
"u"};
247 std::set<std::string> s2 = {
"2",
"3",
"5",
"7"};
248 std::set<std::string> s3 = {
"Hello",
"World"};
250 std::vector<std::set<std::string>> v1 = {};
251 std::vector<std::set<std::string>> v2 = {s1, s2};
252 std::vector<std::set<std::string>> v3 = {s3};
254 std::unordered_map<bool, std::vector<std::set<std::string>>> m1 = {
255 {
true, v1}, {
false, v2}};
256 std::unordered_map<bool, std::vector<std::set<std::string>>> m2 = {
259 std::vector<std::unordered_map<bool, std::vector<std::set<std::string>>>> f1 =
276 std::unordered_map<bool, std::vector<std::set<std::string>>>>>(
284 auto i1 = convertTo<const double>(d1);
288 auto i2 = convertTo<const std::string>(d2);
289 decltype(i2) i2b =
"Hello";
293 auto i3 = convertTo<const bool>(
d3);
297 auto i4 = convertTo<const bool>(
d4);
301 auto i5 = convertTo<const std::pair<const int, const int>>(
d5);
302 decltype(i5) i5b = {1, 2};
311 : kind_(kind), lexeme_(lexeme) {}
318 int k = convertTo<int>(d[
"KIND"]);
319 fbstring lex = convertTo<fbstring>(d[
"LEXEME"]);
320 return Token(k, lex);
327 auto i1 = convertTo<Token>(d1);
375 auto c = std::make_pair(
376 range(vi.begin(), vi.begin() + 3),
377 range(vi.begin() + 1, vi.begin() + 4));
391 const auto int32Over =
392 static_cast<int64_t>(std::numeric_limits<int32_t>().
max()) + 1;
393 const auto floatOver =
394 static_cast<double>(std::numeric_limits<float>().
max()) * 2;
404 std::vector<dynamic>
c{
411 std::unordered_map<std::string, dynamic>
m{{
"one", 1}, {
"two", 2}};
452 return B(convertTo<int>(d));
466 std::vector<bool> bools{
true,
false};
468 auto actual = convertTo<decltype(bools)>(d);
static ObjectMaker object()
#define EXPECT_THROW(statement, expected_exception)
T convertTo(const dynamic &)
static Token convert(const dynamic &d)
#define EXPECT_EQ(val1, val2)
RfcParam d5(false, exampleHex3)
—— Concurrent Priority Queue Implementation ——
RfcParam d6(true, exampleHex4)
Token(int kind, const fbstring &lexeme)
static B convert(const dynamic &d)
RfcParam d4(true, exampleHex2)
static A convert(const dynamic &d)
constexpr Range< Iter > range(Iter first, Iter last)
static map< string, int > m
#define EXPECT_TRUE(condition)
bool operator==(const A &o) const
static void array(EmptyArrayTag)
uint64_t value(const typename LockFreeRingBuffer< T, Atom >::Cursor &rbcursor)
RfcParam d3(false, exampleHex1)
TEST(SequencedExecutor, CPUThreadPoolExecutor)
dynamic toDynamic(const T &)