diff --git a/common/include/valptridx.h b/common/include/valptridx.h index ab17b740e..8da8d3f7d 100644 --- a/common/include/valptridx.h +++ b/common/include/valptridx.h @@ -611,19 +611,16 @@ 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{}; \ - static inline v##prefix##ptridx_t operator-(P Pconst *o, decltype(A) Pconst &O) \ + static inline v##prefix##ptridx_t operator-(Pconst P *o, Pconst valptridx

::array_managed_type &O) \ { \ - return {o, static_cast(const_cast(o) - static_cast(&(const_cast(O).front()))), A}; \ + return {o, static_cast(const_cast(o) - static_cast(&(const_cast::array_managed_type &>(O).front()))), O}; \ } \ #define DEFINE_VALPTRIDX_SUBTYPE(N,P,I,A) \ - static inline constexpr decltype(A) &get_global_array(P *) { return A; } \ - /* "decltype(A) const &" parses correctly, but fails to match */ \ - static inline constexpr typename tt::add_const::type &get_global_array(P const *) { return A; } \ - \ _DEFINE_VALPTRIDX_SUBTYPE_USERTYPE(N,P,I,A,N,); \ _DEFINE_VALPTRIDX_SUBTYPE_USERTYPE(N,P,I,A,c##N,const) \