Merge pull request #4093 from myk002/myk_identity

add identity traits for new types
develop
Myk 2023-12-10 22:02:40 -08:00 committed by GitHub
commit 754e5d57f5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 0 deletions

@ -50,8 +50,12 @@ 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::function<bool()>);
OPAQUE_IDENTITY_TRAITS(std::function<int*()>);
OPAQUE_IDENTITY_TRAITS(std::function<std::string()>);
OPAQUE_IDENTITY_TRAITS(std::optional<std::function<void()> >); OPAQUE_IDENTITY_TRAITS(std::optional<std::function<void()> >);
OPAQUE_IDENTITY_TRAITS(std::variant<std::string, std::function<void()> >); OPAQUE_IDENTITY_TRAITS(std::variant<std::string, std::function<void()> >);
OPAQUE_IDENTITY_TRAITS(std::weak_ptr<df::widget_container>);
buffer_container_identity buffer_container_identity::base_instance; buffer_container_identity buffer_container_identity::base_instance;
} }

@ -37,6 +37,8 @@ distribution.
#include "DataDefs.h" #include "DataDefs.h"
#include <df/widget_container.h>
namespace std { namespace std {
class condition_variable; class condition_variable;
class mutex; class mutex;
@ -578,8 +580,12 @@ 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::function<bool()>);
OPAQUE_IDENTITY_TRAITS(std::function<int*()>);
OPAQUE_IDENTITY_TRAITS(std::function<std::string()>);
OPAQUE_IDENTITY_TRAITS(std::optional<std::function<void()> >); OPAQUE_IDENTITY_TRAITS(std::optional<std::function<void()> >);
OPAQUE_IDENTITY_TRAITS(std::variant<std::string, std::function<void()> >); OPAQUE_IDENTITY_TRAITS(std::variant<std::string, std::function<void()> >);
OPAQUE_IDENTITY_TRAITS(std::weak_ptr<df::widget_container>);
#ifdef BUILD_DFHACK_LIB #ifdef BUILD_DFHACK_LIB
template<typename T> template<typename T>