DataIdentity support for `std::future<void>`

develop
Kelly Kinkade 2023-08-04 20:00:29 -05:00
parent 9bf00904eb
commit ba0df78233
2 changed files with 11 additions and 2 deletions

@ -9,6 +9,9 @@
#include "DataFuncs.h"
#include "DataIdentity.h"
// the space after the uses of "type" in OPAQUE_IDENTITY_TRAITS_NAME is _required_
// without it the macro generates a syntax error when type is a template specification
namespace df {
#define NUMBER_IDENTITY_TRAITS(category, type, name) \
category##_identity<type> identity_traits<type>::identity(name);
@ -45,6 +48,7 @@ namespace df {
STL_OPAQUE_IDENTITY_TRAITS(condition_variable);
STL_OPAQUE_IDENTITY_TRAITS(fstream);
STL_OPAQUE_IDENTITY_TRAITS(mutex);
STL_OPAQUE_IDENTITY_TRAITS(future<void>);
buffer_container_identity buffer_container_identity::base_instance;
#endif

@ -29,6 +29,7 @@ distribution.
#include <sstream>
#include <string>
#include <vector>
#include <future>
#include "DataDefs.h"
@ -546,6 +547,9 @@ namespace df
#define INTEGER_IDENTITY_TRAITS(type) NUMBER_IDENTITY_TRAITS(integer, type)
#define FLOAT_IDENTITY_TRAITS(type) NUMBER_IDENTITY_TRAITS(float, type)
// the space after the use of "type" in OPAQUE_IDENTITY_TRAITS is _required_
// without it the macro generates a syntax error when type is a template specification
#define OPAQUE_IDENTITY_TRAITS(type) \
template<> struct DFHACK_EXPORT identity_traits<type > { \
static opaque_identity identity; \
@ -568,6 +572,7 @@ namespace df
OPAQUE_IDENTITY_TRAITS(std::condition_variable);
OPAQUE_IDENTITY_TRAITS(std::fstream);
OPAQUE_IDENTITY_TRAITS(std::mutex);
OPAQUE_IDENTITY_TRAITS(std::future<void>);
template<> struct DFHACK_EXPORT identity_traits<bool> {
static bool_identity identity;