partially fix clang compilation
Missing header and mistaken algorithm usage. Also removed it name from range loops. It's not correct. Signed-off-by: Rosen Penev <rosenp@gmail.com>
This commit is contained in:
parent
6387cbc0ca
commit
a25ce85c28
@ -225,8 +225,8 @@ 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 (const auto& it : rhs)
|
||||
node.force_insert(it.first, it.second);
|
||||
for (const auto& element : rhs)
|
||||
node.force_insert(element.first, element.second);
|
||||
return node;
|
||||
}
|
||||
|
||||
@ -235,12 +235,12 @@ struct convert<std::map<K, V, C, A>> {
|
||||
return false;
|
||||
|
||||
rhs.clear();
|
||||
for (const auto& it : node)
|
||||
for (const auto& element : node)
|
||||
#if defined(__GNUC__) && __GNUC__ < 4
|
||||
// workaround for GCC 3:
|
||||
rhs[it.first.template as<K>()] = it.second.template as<V>();
|
||||
rhs[element.first.template as<K>()] = element.second.template as<V>();
|
||||
#else
|
||||
rhs[it.first.as<K>()] = it.second.as<V>();
|
||||
rhs[element.first.as<K>()] = element.second.as<V>();
|
||||
#endif
|
||||
return true;
|
||||
}
|
||||
@ -251,7 +251,8 @@ template <typename T, typename A>
|
||||
struct convert<std::vector<T, A>> {
|
||||
static Node encode(const std::vector<T, A>& rhs) {
|
||||
Node node(NodeType::Sequence);
|
||||
std::copy(rhs.begin(), rhs.end(), std::back_inserter(rhs));
|
||||
for (const auto& element : rhs)
|
||||
node.push_back(element);
|
||||
return node;
|
||||
}
|
||||
|
||||
@ -260,12 +261,12 @@ struct convert<std::vector<T, A>> {
|
||||
return false;
|
||||
|
||||
rhs.clear();
|
||||
for (const auto& it : node)
|
||||
for (const auto& element : node)
|
||||
#if defined(__GNUC__) && __GNUC__ < 4
|
||||
// workaround for GCC 3:
|
||||
rhs.push_back(it.template as<T>());
|
||||
rhs.push_back(element.template as<T>());
|
||||
#else
|
||||
rhs.push_back(it.as<T>());
|
||||
rhs.push_back(element.as<T>());
|
||||
#endif
|
||||
return true;
|
||||
}
|
||||
@ -276,7 +277,8 @@ template <typename T, typename A>
|
||||
struct convert<std::list<T,A>> {
|
||||
static Node encode(const std::list<T,A>& rhs) {
|
||||
Node node(NodeType::Sequence);
|
||||
std::copy(rhs.begin(), rhs.end(), std::back_inserter(rhs));
|
||||
for (const auto& element : rhs)
|
||||
node.push_back(element);
|
||||
return node;
|
||||
}
|
||||
|
||||
@ -285,12 +287,12 @@ struct convert<std::list<T,A>> {
|
||||
return false;
|
||||
|
||||
rhs.clear();
|
||||
for (const auto& it : node)
|
||||
for (const auto& element : node)
|
||||
#if defined(__GNUC__) && __GNUC__ < 4
|
||||
// workaround for GCC 3:
|
||||
rhs.push_back(it.template as<T>());
|
||||
rhs.push_back(element.template as<T>());
|
||||
#else
|
||||
rhs.push_back(it.as<T>());
|
||||
rhs.push_back(element.as<T>());
|
||||
#endif
|
||||
return true;
|
||||
}
|
||||
@ -301,7 +303,9 @@ template <typename T, std::size_t N>
|
||||
struct convert<std::array<T, N>> {
|
||||
static Node encode(const std::array<T, N>& rhs) {
|
||||
Node node(NodeType::Sequence);
|
||||
std::copy(rhs.begin(), rhs.end(), std::back_inserter(rhs));
|
||||
for (const auto& element : rhs) {
|
||||
node.push_back(element);
|
||||
}
|
||||
return node;
|
||||
}
|
||||
|
||||
|
||||
@ -158,7 +158,7 @@ inline node& node_data::get(const Key& key, shared_memory_holder pMemory) {
|
||||
});
|
||||
|
||||
if (it != m_map.end()) {
|
||||
return it->second;
|
||||
return *it->second;
|
||||
}
|
||||
|
||||
node& k = convert_to_node(key, pMemory);
|
||||
|
||||
@ -1,3 +1,4 @@
|
||||
#include <algorithm>
|
||||
#include <cassert>
|
||||
#include <iterator>
|
||||
#include <sstream>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user