Code is compatible with GCC 4.8
This commit is contained in:
parent
ef49309782
commit
d400550af7
18
pointer/gcc_4_8_compatibility.h
Normal file
18
pointer/gcc_4_8_compatibility.h
Normal 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
|
@ -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 {
|
||||||
|
Loading…
Reference in New Issue
Block a user