text
stringlengths 0
2.2M
|
---|
dynamic_object["one"] = "two";
|
dynamic_object["eight"] = "ten";
|
// IPAddress
|
auto ipv4 = IPAddress("0.0.0.0");
|
auto ipv6 = IPAddress("2a03:2880:fffe:c:face:b00c:0:35");
|
// SocketAddress
|
auto ipv4socket = SocketAddress("127.0.0.1", 8080);
|
auto ipv6socket = SocketAddress("2a03:2880:fffe:c:face:b00c:0:35", 8080);
|
// F14 containers
|
F14NodeMap<std::string, int> m_node = {{"foo", 0}, {"bar", 1}, {"baz", 2}};
|
F14ValueMap<std::string, int> m_val = {{"foo", 0}};
|
F14VectorMap<std::string, int> m_vec = {{"foo", 0}, {"bar", 1}};
|
F14FastMap<int, std::string> m_fvec = {{42, "foo"}, {43, "bar"}, {44, "baz"}};
|
F14FastMap<int, int> m_fval = {{9, 0}, {8, 1}, {7, 2}};
|
F14NodeSet<std::string> s_node = {"foo", "bar", "baz"};
|
F14NodeSet<int> s_node_large;
|
for (auto i = 0; i < 20; ++i) {
|
s_node_large.emplace(i);
|
}
|
F14ValueSet<std::string> s_val = {"foo", "bar", "baz"};
|
F14ValueSet<uint32_t> s_val_i;
|
for (uint32_t i = 0; i < 20; ++i) {
|
s_val_i.emplace(i);
|
}
|
F14VectorSet<std::string> s_vec = {"foo", "bar", "baz"};
|
F14FastSet<std::string> s_fvec = {"foo", "bar", "baz"};
|
F14FastSet<int> s_fval = {42, 43, 44};
|
typedef F14FastSet<int> F14FastSetTypedef;
|
F14FastSetTypedef s_fval_typedef = {45, 46, 47};
|
const F14FastSet<int>& const_ref = s_fval;
|
asm_gdb_breakpoint();
|
return 0;
|
}
|
/*
|
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
*
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
* you may not use this file except in compliance with the License.
|
* You may obtain a copy of the License at
|
*
|
* http://www.apache.org/licenses/LICENSE-2.0
|
*
|
* Unless required by applicable law or agreed to in writing, software
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
* See the License for the specific language governing permissions and
|
* limitations under the License.
|
*/
|
#include <folly/Benchmark.h>
|
#include <folly/Conv.h>
|
#include <folly/Range.h>
|
#include <map>
|
#include <set>
|
#include <string>
|
#include <unordered_map>
|
#include <unordered_set>
|
#include <folly/experimental/StringKeyedMap.h>
|
#include <folly/experimental/StringKeyedSet.h>
|
#include <folly/experimental/StringKeyedUnorderedMap.h>
|
#include <folly/experimental/StringKeyedUnorderedSet.h>
|
using folly::StringKeyedMap;
|
using folly::StringKeyedSet;
|
using folly::StringKeyedUnorderedMap;
|
using folly::StringKeyedUnorderedSet;
|
using folly::StringPiece;
|
using folly::to;
|
using std::map;
|
using std::set;
|
using std::string;
|
using std::unordered_map;
|
using std::unordered_set;
|
using namespace std::string_literals;
|
static map<string, int> m;
|
static StringKeyedMap<int> skm;
|
static set<string> s;
|
static StringKeyedSet sks;
|
static unordered_map<string, int> um;
|
static StringKeyedUnorderedMap<int> skum;
|
static unordered_set<string> us;
|
static StringKeyedUnorderedSet skus;
|
static const std::string lookup = "1234567890abcdefghijklmnopqrstuvwxyz"s;
|
static const folly::StringPiece lookupPiece{
|
"1234567890abcdefghijklmnopqrstuvwxyz"};
|
static map<string, int, std::less<void>> m_equiv;
|
static set<string, std::less<void>> s_equiv;
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.