From fd676fa70f0870dce209f8554dca40b551ed8ec0 Mon Sep 17 00:00:00 2001 From: lethosor Date: Tue, 12 Sep 2023 23:37:56 -0400 Subject: [PATCH] Add identity_traits for std::unordered_map --- library/include/DataIdentity.h | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/library/include/DataIdentity.h b/library/include/DataIdentity.h index ff15535d1..05df82e79 100644 --- a/library/include/DataIdentity.h +++ b/library/include/DataIdentity.h @@ -25,12 +25,13 @@ distribution. #pragma once #include +#include #include +#include #include #include +#include #include -#include -#include #include "DataDefs.h" @@ -661,6 +662,10 @@ namespace df static container_identity *get(); }; + template struct identity_traits> { + static container_identity *get(); + }; + template<> struct identity_traits > { static bit_array_identity identity; static bit_container_identity *get() { return &identity; } @@ -738,6 +743,13 @@ namespace df return &identity; } + template + inline container_identity *identity_traits>::get() { + typedef std::unordered_map container; + static ro_stl_assoc_container_identity identity("unordered_map", identity_traits::get(), identity_traits::get()); + return &identity; + } + template inline bit_container_identity *identity_traits >::get() { static bit_array_identity identity(identity_traits::get());