diff options
Diffstat (limited to 'include')
| -rw-r--r-- | include/tag_compound.h | 2 | ||||
| -rw-r--r-- | include/tag_list.h | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/include/tag_compound.h b/include/tag_compound.h index 1f1c5f3e1a..8e09ff4834 100644 --- a/include/tag_compound.h +++ b/include/tag_compound.h @@ -127,7 +127,7 @@ private: template<class T, class... Args> std::pair<tag_compound::iterator, bool> tag_compound::emplace(const std::string& key, Args&&... args) { - return put(key, value(T(std::forward<Args>(args)...))); + return put(key, value(make_unique<T>(std::forward<Args>(args)...))); } } diff --git a/include/tag_list.h b/include/tag_list.h index 137b53d5d1..f1f5e6dec1 100644 --- a/include/tag_list.h +++ b/include/tag_list.h @@ -175,7 +175,7 @@ void tag_list::emplace_back(Args&&... args) el_type_ = T::type; else if(el_type_ != T::type) throw std::bad_cast(); - tags.emplace_back(T(std::forward<Args>(args)...)); + tags.emplace_back(make_unique<T>(std::forward<Args>(args)...)); } template<class T, class Arg> @@ -184,7 +184,7 @@ void tag_list::init(std::initializer_list<Arg> init) el_type_ = T::type; tags.reserve(init.size()); for(const Arg& arg: init) - tags.emplace_back(T(arg)); + tags.emplace_back(make_unique<T>(arg)); } } |
