mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-17 08:00:48 +01:00
Core/Misc: Replace tc's optional with boost::optional. (very partial cherry-pick)
* benefits from empty optimization (objects are only constructed if needed).
* supports r-value references (move semantics) (boost >= 1.56.0).
* preparation for c++14/17's std::optional and std::none_t.
* add move constructor to CompactArray.
(cherry picked from commit 800d5d8939)
This commit is contained in:
@@ -44,6 +44,8 @@
|
||||
#include <cerrno>
|
||||
#include <csignal>
|
||||
|
||||
#include <boost/optional.hpp>
|
||||
#include <boost/utility/in_place_factory.hpp>
|
||||
#include <boost/functional/hash.hpp>
|
||||
|
||||
#include "Debugging/Errors.h"
|
||||
@@ -152,6 +154,10 @@ typedef std::vector<std::string> StringVector;
|
||||
|
||||
#define MAX_QUERY_LEN 32*1024
|
||||
|
||||
//! Optional helper class to wrap optional values within.
|
||||
template <typename T>
|
||||
using Optional = boost::optional<T>;
|
||||
|
||||
namespace Trinity
|
||||
{
|
||||
//! std::make_unique implementation (TODO: remove this once C++14 is supported)
|
||||
|
||||
Reference in New Issue
Block a user