From 3a12cb80d8cb855b9a5c6aa8d16c6371346f2372 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cezary=20Skrzy=C5=84ski?= Date: Wed, 12 Aug 2020 19:30:19 +0200 Subject: [PATCH] #939 de-template BaseElmProxy over ColT --- .../collection/proxy_traits/proxy_elm_traits.h | 2 +- src/vt/vrt/proxy/base_collection_elm_proxy.h | 5 ++--- src/vt/vrt/proxy/base_collection_elm_proxy.impl.h | 8 ++++---- src/vt/vrt/proxy/base_elm_proxy.h | 15 +++++++-------- src/vt/vrt/proxy/collection_elm_proxy.h | 2 +- src/vt/vrt/proxy/collection_proxy.impl.h | 2 +- src/vt/vrt/proxy/collection_proxy_untyped.impl.h | 2 +- 7 files changed, 17 insertions(+), 19 deletions(-) diff --git a/src/vt/vrt/collection/proxy_traits/proxy_elm_traits.h b/src/vt/vrt/collection/proxy_traits/proxy_elm_traits.h index eb8370ebbd..48324be400 100644 --- a/src/vt/vrt/collection/proxy_traits/proxy_elm_traits.h +++ b/src/vt/vrt/collection/proxy_traits/proxy_elm_traits.h @@ -59,7 +59,7 @@ namespace vt { namespace vrt { namespace collection { namespace elm_proxy { template -using Chain4 = LBable>; +using Chain4 = LBable>; template using Chain3 = Gettable>; diff --git a/src/vt/vrt/proxy/base_collection_elm_proxy.h b/src/vt/vrt/proxy/base_collection_elm_proxy.h index 55c717918d..06f1821799 100644 --- a/src/vt/vrt/proxy/base_collection_elm_proxy.h +++ b/src/vt/vrt/proxy/base_collection_elm_proxy.h @@ -50,12 +50,11 @@ namespace vt { namespace vrt { namespace collection { -template +template struct BaseCollectionElmProxy { - using CollectionType = ColT; using IndexType = IndexT; using ProxyType = VirtualProxyType; - using ElementProxyType = BaseElmProxy; + using ElementProxyType = BaseElmProxy; BaseCollectionElmProxy() = default; BaseCollectionElmProxy( diff --git a/src/vt/vrt/proxy/base_collection_elm_proxy.impl.h b/src/vt/vrt/proxy/base_collection_elm_proxy.impl.h index a972366d5f..85c52b9ad0 100644 --- a/src/vt/vrt/proxy/base_collection_elm_proxy.impl.h +++ b/src/vt/vrt/proxy/base_collection_elm_proxy.impl.h @@ -51,15 +51,15 @@ namespace vt { namespace vrt { namespace collection { -template -BaseCollectionElmProxy::BaseCollectionElmProxy( +template +BaseCollectionElmProxy::BaseCollectionElmProxy( ProxyType const& in_col_proxy, ElementProxyType const& in_elm_proxy ) : col_proxy_(in_col_proxy), elm_proxy_(in_elm_proxy) { } -template +template template -void BaseCollectionElmProxy::serialize(SerializerT& s) { +void BaseCollectionElmProxy::serialize(SerializerT& s) { s | col_proxy_ | elm_proxy_; } diff --git a/src/vt/vrt/proxy/base_elm_proxy.h b/src/vt/vrt/proxy/base_elm_proxy.h index a491b85b74..b160e30ff1 100644 --- a/src/vt/vrt/proxy/base_elm_proxy.h +++ b/src/vt/vrt/proxy/base_elm_proxy.h @@ -58,10 +58,9 @@ namespace vt { namespace vrt { namespace collection { static struct virtual_proxy_elm_empty { } virtual_proxy_elm_empty_tag { }; #pragma GCC diagnostic pop -template +template struct BaseElmProxy { using IndexType = IndexT; - using CollectionType = ColT; explicit BaseElmProxy(IndexT const& in_idx) : idx_(in_idx) @@ -90,14 +89,14 @@ struct BaseElmProxy { }}} /* end namespace vt::vrt::collection */ -template -using ElmType = ::vt::vrt::collection::BaseElmProxy; +template +using ElmType = ::vt::vrt::collection::BaseElmProxy; namespace std { - template - struct hash> { - size_t operator()(ElmType const& in) const { - return std::hash::IndexType>()( + template + struct hash> { + size_t operator()(ElmType const& in) const { + return std::hash::IndexType>()( in.getIndex() ); } diff --git a/src/vt/vrt/proxy/collection_elm_proxy.h b/src/vt/vrt/proxy/collection_elm_proxy.h index 49f5568432..11c73fb76e 100644 --- a/src/vt/vrt/proxy/collection_elm_proxy.h +++ b/src/vt/vrt/proxy/collection_elm_proxy.h @@ -65,7 +65,7 @@ struct VrtElmProxy : ProxyCollectionElmTraits { VrtElmProxy( VirtualProxyType const& in_col_proxy, - BaseElmProxy const& in_elm_proxy + BaseElmProxy const& in_elm_proxy ) : ProxyCollectionElmTraits(in_col_proxy, in_elm_proxy) { } diff --git a/src/vt/vrt/proxy/collection_proxy.impl.h b/src/vt/vrt/proxy/collection_proxy.impl.h index 25f27f1077..3370b5aaec 100644 --- a/src/vt/vrt/proxy/collection_proxy.impl.h +++ b/src/vt/vrt/proxy/collection_proxy.impl.h @@ -83,7 +83,7 @@ CollectionProxy::operator()(Tp&& tp, Tn&&... tn) const { template typename CollectionProxy::ElmProxyType CollectionProxy::index(IndexT const& idx) const { - return ElmProxyType{this->proxy_,BaseElmProxy{idx}}; + return ElmProxyType{this->proxy_,BaseElmProxy{idx}}; } template diff --git a/src/vt/vrt/proxy/collection_proxy_untyped.impl.h b/src/vt/vrt/proxy/collection_proxy_untyped.impl.h index f8e4c8cb45..2a6a4d43f7 100644 --- a/src/vt/vrt/proxy/collection_proxy_untyped.impl.h +++ b/src/vt/vrt/proxy/collection_proxy_untyped.impl.h @@ -58,7 +58,7 @@ namespace vt { namespace vrt { namespace collection { template CollectionUntypedProxy::ElmProxyType CollectionUntypedProxy::index(IndexT const& idx) const { - return ElmProxyType{proxy_,BaseElmProxy{idx}}; + return ElmProxyType{proxy_,BaseElmProxy{idx}}; } template