WIP: const correctnes: Record is conceived as immutable

...and so should be all the exposed iterators.
Thanks, dear C++ compiler for spotting this subtle mismatch!
This commit is contained in:
Fischlurch 2015-06-06 00:11:12 +02:00
parent 96e10faa84
commit 28c27243c8
2 changed files with 2 additions and 2 deletions

View file

@ -186,7 +186,7 @@ namespace diff{
/* ==== Exposing scope and contents for iteration ====== */ /* ==== Exposing scope and contents for iteration ====== */
using iterator = IterAdapter<typename _Vec::const_iterator, const Record*>; using iterator = IterAdapter<typename _Vec::const_iterator, const Record*>;
using scopeIter = typename iter_stl::_SeqT<_Vec>::Range; using scopeIter = typename iter_stl::_SeqT<const _Vec>::Range;
using keyIter = TransformIter<scopeIter, string>; using keyIter = TransformIter<scopeIter, string>;
using valIter = TransformIter<scopeIter, VAL>; using valIter = TransformIter<scopeIter, VAL>;

View file

@ -190,7 +190,7 @@ namespace test{
CHECK (!isSameObject (a.get("a"), b.get("a"))); CHECK (!isSameObject (a.get("a"), b.get("a")));
CHECK (!isSameObject (*a.scope(), *b.scope())); CHECK (!isSameObject (*a.scope(), *b.scope()));
string& c = *b.scope(); string const& c = *b.scope();
CHECK ("c" == c); CHECK ("c" == c);
RecS bb; RecS bb;