Code is compatible with GCC 4.8

This commit is contained in:
Sebastian Messmer 2015-11-24 14:32:53 +01:00
parent ef49309782
commit d400550af7
2 changed files with 19 additions and 0 deletions

View File

@ -0,0 +1,18 @@
#pragma once
#ifndef MESSMER_CPPUTILS_GCC48COMPATIBILITY_H
#define MESSMER_CPPUTILS_GCC48COMPATIBILITY_H
#include <memory>
#if __GNUC__ == 4 && __GNUC_MINOR__ == 8
// Add std::make_unique
namespace std {
template<typename T, typename... Args>
inline unique_ptr<T> make_unique(Args&&... args) {
return unique_ptr<T>(new T(std::forward<Args>(args)...));
}
}
#endif
#endif

View File

@ -5,6 +5,7 @@
#include <memory> #include <memory>
#include <boost/optional.hpp> #include <boost/optional.hpp>
#include "../macros.h" #include "../macros.h"
#include "gcc_4_8_compatibility.h"
#include "cast.h" #include "cast.h"
namespace cpputils { namespace cpputils {