add const_iterator to shared_vector

This commit is contained in:
Michael Davidsaver
2013-05-30 19:16:22 -04:00
parent 41425b3fa1
commit 3b6268a4fc
2 changed files with 32 additions and 4 deletions

View File

@@ -206,9 +206,28 @@ static void testConst()
testOk1(rodata[1]==100);
// intentionally modify shared data!
// safe since this thread owns all references.
writable[1]=200;
testOk1(rodata[1]==200);
epics::pvData::shared_vector<int>::const_iterator a;
epics::pvData::shared_vector<const int>::iterator b;
epics::pvData::shared_vector<const int>::const_iterator c;
a = writable.begin();
b = rodata.begin();
c = rodata.end();
testOk1(std::equal(b, c, a));
a = writable.cbegin();
c = rodata.cend();
epics::pvData::shared_vector<int>::const_reference x = rodata[1];
testOk1(x==200);
}
static void testSlice()
@@ -318,7 +337,7 @@ static void testVoid()
MAIN(testSharedVector)
{
testPlan(99);
testPlan(101);
testDiag("Tests for shared_vector");
testDiag("sizeof(shared_vector<int>)=%lu",