mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-17 16:10:49 +01:00
Fixed clang segmentation fault in nopch mode
This commit is contained in:
@@ -17,10 +17,10 @@
|
||||
|
||||
#include "QueryCallback.h"
|
||||
|
||||
template<typename T>
|
||||
inline void Construct(T& t)
|
||||
template<typename T, typename... Args>
|
||||
inline void Construct(T& t, Args&&... args)
|
||||
{
|
||||
new (&t) T();
|
||||
new (&t) T(std::forward<Args>(args)...);
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
@@ -103,12 +103,17 @@ private:
|
||||
bool _isPrepared;
|
||||
};
|
||||
|
||||
QueryCallback::QueryCallback(std::future<QueryResult>&& result) : _string(std::move(result)), _isPrepared(false)
|
||||
// Not using initialization lists to work around segmentation faults when compiling with clang without precompiled headers
|
||||
QueryCallback::QueryCallback(std::future<QueryResult>&& result)
|
||||
{
|
||||
_isPrepared = false;
|
||||
Construct(_string, std::move(result));
|
||||
}
|
||||
|
||||
QueryCallback::QueryCallback(std::future<PreparedQueryResult>&& result) : _prepared(std::move(result)), _isPrepared(true)
|
||||
QueryCallback::QueryCallback(std::future<PreparedQueryResult>&& result)
|
||||
{
|
||||
_isPrepared = true;
|
||||
Construct(_prepared, std::move(result));
|
||||
}
|
||||
|
||||
QueryCallback::QueryCallback(QueryCallback&& right)
|
||||
|
||||
Reference in New Issue
Block a user