diff options
Diffstat (limited to 'src/server/shared')
| -rw-r--r-- | src/server/shared/Common.h | 6 | ||||
| -rw-r--r-- | src/server/shared/Utilities/Util.h | 21 |
2 files changed, 6 insertions, 21 deletions
diff --git a/src/server/shared/Common.h b/src/server/shared/Common.h index 8a1ccf6029a..4e1e24cce42 100644 --- a/src/server/shared/Common.h +++ b/src/server/shared/Common.h @@ -39,6 +39,8 @@ #include <sstream> #include <algorithm> +#include <boost/optional.hpp> + #include "Debugging/Errors.h" #include "Threading/LockedQueue.h" @@ -157,4 +159,8 @@ struct LocalizedString #define MAX_QUERY_LEN 32*1024 +//! Optional helper class to wrap optional values within. +template <typename T> +using Optional = boost::optional<T>; + #endif diff --git a/src/server/shared/Utilities/Util.h b/src/server/shared/Utilities/Util.h index 9a8514ea5ca..0886b625370 100644 --- a/src/server/shared/Utilities/Util.h +++ b/src/server/shared/Utilities/Util.h @@ -30,27 +30,6 @@ #include <stdarg.h> #include <cstring> -template<typename T> -struct Optional -{ - Optional() : Value(), HasValue(false) { } - - T Value; - bool HasValue; - - inline void Set(T const& v) - { - HasValue = true; - Value = v; - } - - inline void Clear() - { - HasValue = false; - Value = T(); - } -}; - // Searcher for map of structs template<typename T, class S> struct Finder { |
