Merge pull request #6009 from Icinga/fix/build-fix-gcc

Build fix for ancient versions of GCC
This commit is contained in:
Gunnar Beutner 2018-01-18 15:29:50 +01:00 committed by GitHub
commit 7702cb056a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 4 deletions

View File

@ -32,13 +32,13 @@ REGISTER_PRIMITIVE_TYPE(Dictionary, Object, Dictionary::GetPrototype());
Dictionary::Dictionary(const DictionaryData& other)
{
for (const auto& kv : other)
m_Data.emplace(kv);
m_Data.insert(kv);
}
Dictionary::Dictionary(DictionaryData&& other)
{
for (auto& kv : other)
m_Data.emplace(std::move(kv));
m_Data.insert(std::move(kv));
}
Dictionary::Dictionary(std::initializer_list<Dictionary::Pair> init)

View File

@ -129,10 +129,10 @@ struct Lazy
operator Lazy<U>() const
{
if (m_Cached)
return Lazy<U>(m_Value);
return Lazy<U>(static_cast<U>(m_Value));
else {
Accessor accessor = m_Accessor;
return Lazy<U>([accessor]() { return static_cast<U>(accessor()); });
return Lazy<U>(static_cast<typename Lazy<U>::Accessor>([accessor]() { return static_cast<U>(accessor()); }));
}
}