This commit is contained in:
theNerd247 2016-10-02 14:52:52 +00:00 committed by GitHub
commit 3c4057e653

View File

@ -162,17 +162,17 @@ struct convert<bool> {
};
// std::map
template <typename K, typename V>
struct convert<std::map<K, V> > {
static Node encode(const std::map<K, V>& rhs) {
template <typename K, typename V, typename C, typename A>
struct convert<std::map<K,V,C,A> > {
static Node encode(const std::map<K,V,C,A>& rhs) {
Node node(NodeType::Map);
for (typename std::map<K, V>::const_iterator it = rhs.begin();
for (typename std::map<K,V,C,A>::const_iterator it = rhs.begin();
it != rhs.end(); ++it)
node.force_insert(it->first, it->second);
return node;
}
static bool decode(const Node& node, std::map<K, V>& rhs) {
static bool decode(const Node& node, std::map<K,V,C,A>& rhs) {
if (!node.IsMap())
return false;
@ -189,17 +189,17 @@ struct convert<std::map<K, V> > {
};
// std::vector
template <typename T>
struct convert<std::vector<T> > {
static Node encode(const std::vector<T>& rhs) {
template <typename T, typename A>
struct convert<std::vector<T,A> > {
static Node encode(const std::vector<T,A>& rhs) {
Node node(NodeType::Sequence);
for (typename std::vector<T>::const_iterator it = rhs.begin();
for (typename std::vector<T,A>::const_iterator it = rhs.begin();
it != rhs.end(); ++it)
node.push_back(*it);
return node;
}
static bool decode(const Node& node, std::vector<T>& rhs) {
static bool decode(const Node& node, std::vector<T,A>& rhs) {
if (!node.IsSequence())
return false;
@ -216,17 +216,17 @@ struct convert<std::vector<T> > {
};
// std::list
template <typename T>
struct convert<std::list<T> > {
static Node encode(const std::list<T>& rhs) {
template <typename T, typename A>
struct convert<std::list<T,A> > {
static Node encode(const std::list<T,A>& rhs) {
Node node(NodeType::Sequence);
for (typename std::list<T>::const_iterator it = rhs.begin();
for (typename std::list<T,A>::const_iterator it = rhs.begin();
it != rhs.end(); ++it)
node.push_back(*it);
return node;
}
static bool decode(const Node& node, std::list<T>& rhs) {
static bool decode(const Node& node, std::list<T,A>& rhs) {
if (!node.IsSequence())
return false;