diff --git a/src/misc/pv/sharedVector.h b/src/misc/pv/sharedVector.h index 24dd52d..b092d91 100644 --- a/src/misc/pv/sharedVector.h +++ b/src/misc/pv/sharedVector.h @@ -553,7 +553,11 @@ class shared_vector::type > { typedef detail::shared_vector_base base_t; ScalarType m_vtype; + + // allow specialization for all E to be friends + template friend class shared_vector; public: + typedef E value_type; typedef E* pointer; typedef ptrdiff_t difference_type; typedef size_t size_type; diff --git a/testApp/misc/testSharedVector.cpp b/testApp/misc/testSharedVector.cpp index 36dfa86..6bdcddc 100644 --- a/testApp/misc/testSharedVector.cpp +++ b/testApp/misc/testSharedVector.cpp @@ -372,7 +372,10 @@ static void testVoid() testOk1(typed.dataOffset()==1); testOk1(typed.size()==2); untyped.clear(); +} +static void testConstVoid() +{ testDiag("Test vector cast to/from const void"); epics::pvData::shared_vector ctyped(4); @@ -390,6 +393,11 @@ static void testVoid() testOk1(ctyped.dataOffset()==1); testOk1(ctyped.size()==2); + + epics::pvData::shared_vector untyped; + // not possible to thaw() void as shared_vector has no make_unique() + //untyped = thaw(cuntyped); + cuntyped = freeze(untyped); } struct dummyStruct {}; @@ -630,6 +638,7 @@ MAIN(testSharedVector) testSlice(); testPush(); testVoid(); + testConstVoid(); testNonPOD(); testVectorConvert(); testWeak();