This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace details { | |
template <size_t fmt_len, typename... Args> | |
struct format_to_h; | |
template <size_t fmt_len, typename Arg, typename... Args> | |
struct format_to_h<fmt_len, Arg, Args...> { | |
auto operator()(std::ostream & out, char const (&fmt)[fmt_len], size_t fmt_start, Arg && arg, Args && ... args) -> void { | |
auto const braces = std::strstr(&fmt[fmt_start], "{}"); | |
if (braces == nullptr) { | |
format_to_h<fmt_len>()(out, fmt, fmt_start); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#define let auto const | |
class Ipv4 { | |
public: | |
using Value = std::array<uint8_t, 4>; | |
static constexpr auto ipv4_str_max_size = 3 + 1 + 3 + 1 + 3 + 1 + 3 + 1; | |
public: | |
explicit Ipv4(char const * ipv4, bool strict = false): | |
Ipv4(ipv4, -1, strict) {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <memory> | |
#include <stdexcept> | |
#include <string> | |
#include <string> | |
#include <tuple> | |
#include <type_traits> | |
#include <unordered_map> | |
#define let auto const | |
// 约束 |