Merge pull request #4090 from myk002/myk_variant

add identity for variant
develop
Myk 2023-12-10 03:21:10 -08:00 committed by GitHub
commit 7534d326e0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 10 additions and 3 deletions

@ -49,7 +49,9 @@ namespace df {
STL_OPAQUE_IDENTITY_TRAITS(mutex); STL_OPAQUE_IDENTITY_TRAITS(mutex);
STL_OPAQUE_IDENTITY_TRAITS(future<void>); STL_OPAQUE_IDENTITY_TRAITS(future<void>);
STL_OPAQUE_IDENTITY_TRAITS(function<void()>); STL_OPAQUE_IDENTITY_TRAITS(function<void()>);
STL_OPAQUE_IDENTITY_TRAITS(optional<std::function<void()> >); STL_OPAQUE_IDENTITY_TRAITS(optional<void_function>);
OPAQUE_IDENTITY_TRAITS_NAME(std::variant<std::string COMMA void_function>,
"variant<string, void_function>");
buffer_container_identity buffer_container_identity::base_instance; buffer_container_identity buffer_container_identity::base_instance;
} }

@ -31,6 +31,7 @@ distribution.
#include <sstream> #include <sstream>
#include <string> #include <string>
#include <unordered_map> #include <unordered_map>
#include <variant>
#include <vector> #include <vector>
#include "DataDefs.h" #include "DataDefs.h"
@ -576,7 +577,11 @@ namespace df
OPAQUE_IDENTITY_TRAITS(std::mutex); OPAQUE_IDENTITY_TRAITS(std::mutex);
OPAQUE_IDENTITY_TRAITS(std::future<void>); OPAQUE_IDENTITY_TRAITS(std::future<void>);
OPAQUE_IDENTITY_TRAITS(std::function<void()>); OPAQUE_IDENTITY_TRAITS(std::function<void()>);
OPAQUE_IDENTITY_TRAITS(std::optional<std::function<void()> >);
typedef std::function<void()> void_function;
#define COMMA ,
OPAQUE_IDENTITY_TRAITS(std::optional<void_function>);
OPAQUE_IDENTITY_TRAITS(std::variant<std::string COMMA void_function>);
#ifdef BUILD_DFHACK_LIB #ifdef BUILD_DFHACK_LIB
template<typename T> template<typename T>

@ -1 +1 @@
Subproject commit bdf4b660d5282fdf722293609675a633fd5a641e Subproject commit e049cb4df86d116689c0ef84bf1962d282b7b880