1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-02-22 23:39:42 +00:00

Merge pull request #2011 from elsid/fix_misc_guarded_msvc2015_crash

Use explicit default ctors call
This commit is contained in:
Bret Curtis 2018-11-02 10:29:38 +01:00 committed by GitHub
commit 782aa3e584
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -38,19 +38,25 @@ namespace Misc
class ScopeGuarded
{
public:
ScopeGuarded() = default;
ScopeGuarded()
: mMutex()
, mValue()
{}
ScopeGuarded(const T& value)
: mValue(value)
: mMutex()
, mValue(value)
{}
ScopeGuarded(T&& value)
: mValue(std::move(value))
: mMutex()
, mValue(std::move(value))
{}
template <class ... Args>
ScopeGuarded(Args&& ... args)
: mValue(std::forward<Args>(args) ...)
: mMutex()
, mValue(std::forward<Args>(args) ...)
{}
ScopeGuarded(const ScopeGuarded& other)
@ -83,7 +89,7 @@ namespace Misc
{
public:
SharedGuarded()
: mMutex(std::make_shared<std::mutex>())
: mMutex(std::make_shared<std::mutex>()), mValue()
{}
SharedGuarded(std::shared_ptr<T> value)