From fc106eba515c8b1efb013634bbabec405ecf5b22 Mon Sep 17 00:00:00 2001 From: Naios Date: Sun, 26 Apr 2015 23:45:52 +0200 Subject: 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 800d5d893964a82265577d3352d683035b589f78) --- src/common/Common.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src') diff --git a/src/common/Common.h b/src/common/Common.h index 8216c519746..aa04abacd30 100644 --- a/src/common/Common.h +++ b/src/common/Common.h @@ -44,6 +44,8 @@ #include #include +#include +#include #include #include "Debugging/Errors.h" @@ -152,6 +154,10 @@ typedef std::vector StringVector; #define MAX_QUERY_LEN 32*1024 +//! Optional helper class to wrap optional values within. +template +using Optional = boost::optional; + namespace Trinity { //! std::make_unique implementation (TODO: remove this once C++14 is supported) -- cgit v1.2.3