Skip to content

Commit

Permalink
add check for cpp version in lib/util.h (#30)
Browse files Browse the repository at this point in the history
Co-authored-by: liamembark <[email protected]>
  • Loading branch information
daniel-feldman-ai and liambenson authored Mar 4, 2022
1 parent 07c69ce commit f8ba583
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/util.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,15 @@
#include <boost/iostreams/stream.hpp>

namespace Embag {

#if __cplusplus < 201402L
// std::make_unique is not available in c++11 :(
template<typename T, typename... Args>
std::unique_ptr<T> make_unique(Args &&... args) {
return std::unique_ptr<T>(new T(std::forward<Args>(args)...));
}

using message_stream = boost::iostreams::stream<boost::iostreams::array_source>;

#else
using std::make_unique;
#endif
}

0 comments on commit f8ba583

Please sign in to comment.