78 std::string_view from1, std::string_view to1,
79 std::string_view from2, std::string_view to2,
80 std::string_view from3, std::string_view to3)
82 return [=](std::string_view s) {
83 if (s == from1)
return to1;
84 if (s == from2)
return to2;
85 if (s == from3)
return to3;
91 std::string_view from1, std::string_view to1,
92 std::string_view from2, std::string_view to2,
93 std::string_view from3, std::string_view to3,
94 std::string_view from4, std::string_view to4)
96 return [=](std::string_view s) {
97 if (s == from1)
return to1;
98 if (s == from2)
return to2;
99 if (s == from3)
return to3;
100 if (s == from4)
return to4;
130 constexpr size_t N =
sizeof...(Is);
131 std::array<FromTo, N> arr{
FromTo{std::get<2 * Is>(tuple), std::get<2 * Is + 1>(tuple)}...};
133 auto hash = [](std::string_view s) {
return fnvHash(s); };
134 auto getKey = [&](
size_t i) {
return arr[i].from; };
135 auto pmh = PerfectMinimalHash::create<N>(hash, getKey);