From 45f1a714203d055db0c2643809d0e50e3920f07c Mon Sep 17 00:00:00 2001 From: Kp Date: Tue, 8 Dec 2015 04:20:24 +0000 Subject: [PATCH] Move valptridx get_global_array to DXX_VALPTRIDX_DECLARE_GLOBAL_SUBTYPE This removes the need to repeat the array name when invoking DEFINE_VALPTRIDX_SUBTYPE. --- common/include/fwd-valptridx.h | 2 ++ common/include/valptridx.h | 1 - 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/common/include/fwd-valptridx.h b/common/include/fwd-valptridx.h index 207a8ac15..13f05e5e9 100644 --- a/common/include/fwd-valptridx.h +++ b/common/include/fwd-valptridx.h @@ -116,4 +116,6 @@ public: #define DXX_VALPTRIDX_DECLARE_GLOBAL_SUBTYPE(managed_type,derived_type_prefix,global_array,array_size_value) \ valptridx_specialized_type_parameters valptridx_specialized_type(managed_type *); \ extern valptridx::array_managed_type global_array; \ + static constexpr const valptridx::array_managed_type &get_global_array(const managed_type *) { return global_array; } \ + static constexpr valptridx::array_managed_type &get_global_array(managed_type *) { return global_array; } \ DXX_VALPTRIDX_SUBTYPE(DXX_VALPTRIDX_DEFINE_SUBTYPE_TYPEDEF, managed_type, derived_type_prefix) diff --git a/common/include/valptridx.h b/common/include/valptridx.h index 7534188b7..3d9a45bb6 100644 --- a/common/include/valptridx.h +++ b/common/include/valptridx.h @@ -616,7 +616,6 @@ public: }; #define _DEFINE_VALPTRIDX_SUBTYPE_USERTYPE(N,P,I,A,prefix,Pconst) \ - static constexpr Pconst valptridx

::array_managed_type &get_global_array(P Pconst *) { return A; } \ constexpr valptridx

::basic_vptr_global_factory v##prefix##ptr{}; \ constexpr valptridx

::basic_ptridx_global_factory prefix##ptridx{}; \ constexpr valptridx

::basic_vptr_global_factory v##prefix##ptridx{}; \