diff --git a/include/bitcoin/system/data/memory.hpp b/include/bitcoin/system/data/memory.hpp index 3ffb4d7fa4..baa45ac7e1 100644 --- a/include/bitcoin/system/data/memory.hpp +++ b/include/bitcoin/system/data/memory.hpp @@ -66,7 +66,12 @@ inline std::shared_ptr to_shared(const Type& value) NOEXCEPT template inline std::shared_ptr to_shared(Args&&... values) NOEXCEPT { +// Type{} required due to CLang bug. +#if defined HAVE_CLANG + return std::make_shared(Type{ std::forward(values)... }); +#else return std::make_shared(std::forward(values)...); +#endif } /// Obtain non constant pointer from shared_ptr to const. @@ -123,7 +128,11 @@ template inline std::unique_ptr to_unique(Args&&... values) NOEXCEPT { // Type{} required due to CLang bug. +#if defined HAVE_CLANG return std::make_unique(Type{ std::forward(values)... }); +#else + return std::make_unique(std::forward(values)...); +#endif } BC_POP_WARNING()