45#ifndef __SERIALIZE_HANDLERS_HH__
46#define __SERIALIZE_HANDLERS_HH__
77template <
class T,
class Enable=
void>
85 parse(
const std::string &
s, T &value)
95 parse(
const std::string &
s,
bool &value)
105 parse(
const std::string &
s, std::string &value)
124template <
class T,
class Enabled=
void>
127 static void show(std::ostream &
os,
const T &value) {
os << value; }
134 std::is_same_v<unsigned char, T> ||
135 std::is_same_v<signed char, T>>>
140 if (std::is_signed_v<T>)
143 os << (
unsigned int)value;
151 show(std::ostream &
os,
const bool &value)
154 os << (value ?
"true" :
"false");
Copyright (c) 2024 - Pranith Kumar Copyright (c) 2020 Inria All rights reserved.
bool to_number(const std::string &value, Pixel &retval)
bool to_bool(const std::string &value, bool &retval)
Turn a string representation of a boolean into a boolean value.
Overload hash function for BasicBlockRange type.
static bool parse(const std::string &s, T &value)
static bool parse(const std::string &s, bool &value)
static bool parse(const std::string &s, std::string &value)
static void show(std::ostream &os, const T &value)
static void show(std::ostream &os, const bool &value)
static void show(std::ostream &os, const T &value)