fix freeze() of shared_vector<void>

This commit is contained in:
Michael Davidsaver
2016-02-24 14:22:18 -05:00
parent a90405c25a
commit a8ba831f5e
2 changed files with 13 additions and 0 deletions

View File

@@ -553,7 +553,11 @@ class shared_vector<E, typename meta::is_void<E>::type >
{
typedef detail::shared_vector_base<E> base_t;
ScalarType m_vtype;
// allow specialization for all E to be friends
template<typename E1, class Enable1> friend class shared_vector;
public:
typedef E value_type;
typedef E* pointer;
typedef ptrdiff_t difference_type;
typedef size_t size_type;

View File

@@ -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<const int32> ctyped(4);
@@ -390,6 +393,11 @@ static void testVoid()
testOk1(ctyped.dataOffset()==1);
testOk1(ctyped.size()==2);
epics::pvData::shared_vector<void> untyped;
// not possible to thaw() void as shared_vector<void> 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();