added fully defined templates for std containers
* updated containers for: vector, map, and list to use fully defined template parameters as per the std lib.
This commit is contained in:
parent
728e26e426
commit
d0075166ec
@ -161,17 +161,17 @@ struct convert<bool> {
|
|||||||
};
|
};
|
||||||
|
|
||||||
// std::map
|
// std::map
|
||||||
template <typename K, typename V>
|
template <typename K, typename V, typename C, typename A>
|
||||||
struct convert<std::map<K, V> > {
|
struct convert<std::map<K,V,C,A> > {
|
||||||
static Node encode(const std::map<K, V>& rhs) {
|
static Node encode(const std::map<K,V,C,A>& rhs) {
|
||||||
Node node(NodeType::Map);
|
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)
|
it != rhs.end(); ++it)
|
||||||
node.force_insert(it->first, it->second);
|
node.force_insert(it->first, it->second);
|
||||||
return node;
|
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())
|
if (!node.IsMap())
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
@ -188,17 +188,17 @@ struct convert<std::map<K, V> > {
|
|||||||
};
|
};
|
||||||
|
|
||||||
// std::vector
|
// std::vector
|
||||||
template <typename T>
|
template <typename T, typename A>
|
||||||
struct convert<std::vector<T> > {
|
struct convert<std::vector<T,A> > {
|
||||||
static Node encode(const std::vector<T>& rhs) {
|
static Node encode(const std::vector<T,A>& rhs) {
|
||||||
Node node(NodeType::Sequence);
|
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)
|
it != rhs.end(); ++it)
|
||||||
node.push_back(*it);
|
node.push_back(*it);
|
||||||
return node;
|
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())
|
if (!node.IsSequence())
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
@ -215,17 +215,17 @@ struct convert<std::vector<T> > {
|
|||||||
};
|
};
|
||||||
|
|
||||||
// std::list
|
// std::list
|
||||||
template <typename T>
|
template <typename T, typename A>
|
||||||
struct convert<std::list<T> > {
|
struct convert<std::list<T,A> > {
|
||||||
static Node encode(const std::list<T>& rhs) {
|
static Node encode(const std::list<T,A>& rhs) {
|
||||||
Node node(NodeType::Sequence);
|
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)
|
it != rhs.end(); ++it)
|
||||||
node.push_back(*it);
|
node.push_back(*it);
|
||||||
return node;
|
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())
|
if (!node.IsSequence())
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user