[dune-pdelab] [dune-pdelab-commit] dune-pdelab - Commit a434d43: [ISTL] Make vector_iterator a friend of all other vector_iterators, independent of template arguments

Steffen Müthing steffen.muething at ipvs.uni-stuttgart.de
Wed Dec 19 14:38:10 CET 2012


Am 19.12.2012 um 13:50 schrieb Christian Engwer:

> On Wed, Dec 19, 2012 at 11:55:30AM +0100, Steffen Müthing wrote:
>> New commit, added to repository at Wed Dec 19 11:55:30 2012 +0100
>> as part of the following ref changes:
>> 
>>    branch refs/heads/feature/new-dof-handling    updated from f57bfaf -> 006a003
>> 
>> Browsable version: http://cgit.dune-project.org/repositories/dune-pdelab/commit/?id=a434d43cc4985c523b092758359231f041a8ab93
>> 
>> ======================================================================
>> 
>> commit a434d43cc4985c523b092758359231f041a8ab93
>> Author: Steffen Müthing <muething at dune-project.org>
>> Date:   Wed Dec 19 11:42:17 2012 +0100
>> 
>>    [ISTL] Make vector_iterator a friend of all other vector_iterators, independent of template arguments
>> 
>>    vector_iterator needs to be able to access the private members of other vector_iterators
>>    with different template parameters to implement const <-> non-const interoperability.
> 
> actually it should be sufficient to only have the friend for 
> 
> 		 friend class vector_iterator<const V>;
> 		 friend class vector_iterator< typename RemoveConst<V>::Type >;
> 
> shouldn't it?!

Well, that's true, but who cares? ;-) Anyone who is determined enough to exploit that problem (you'd have to specialize the class
for that) deserves to fall flat on his face IMHO…

Steffen

> 
>> dune/pdelab/backend/istl/vectoriterator.hh | 5 ++++-
>> 1 file changed, 4 insertions(+), 1 deletion(-)
>> 
>> 
>> 
>> diff --git a/dune/pdelab/backend/istl/vectoriterator.hh b/dune/pdelab/backend/istl/vectoriterator.hh
>> index 4f10ff2..e3e3e84 100644
>> --- a/dune/pdelab/backend/istl/vectoriterator.hh
>> +++ b/dune/pdelab/backend/istl/vectoriterator.hh
>> @@ -179,7 +179,7 @@ namespace Dune {
>>       }
>> 
>>       template<typename V>
>> -      struct vector_iterator
>> +      class vector_iterator
>>         : public impl::vector_iterator_base<V>
>>       {
>> 
>> @@ -190,6 +190,9 @@ namespace Dune {
>>         typedef typename impl::extract_iterators<V>::type Iterators;
>>         static const bool is_const = BaseT::is_const;
>> 
>> +        template<typename>
>> +        friend class vector_iterator;
>> +
>>       public:
>> 
>>         vector_iterator(vector_reference vector, bool at_end)
>> 
>> _______________________________________________
>> dune-pdelab-commit mailing list
>> dune-pdelab-commit at dune-project.org
>> http://lists.dune-project.org/mailman/listinfo/dune-pdelab-commit
> 
> -- 
> Prof. Dr. Christian Engwer 
> Institut für Numerische und Angewandte Mathematik
> Fachbereich Mathematik und Informatik der Universität Münster
> Einsteinstrasse 62
> 48149 Münster
> 
> E-Mail	christian.engwer at uni-muenster.de
> Telefon	+49 251 83-35067
> FAX		+49 251 83-32729
> 
> _______________________________________________
> dune-pdelab mailing list
> dune-pdelab at dune-project.org
> http://lists.dune-project.org/mailman/listinfo/dune-pdelab

Steffen Müthing
Universität Stuttgart
Institut für Parallele und Verteilte Systeme
Universitätsstr. 38
70569 Stuttgart
Tel: +49 711 685 88429
Fax: +49 711 685 88340
Email: steffen.muething at ipvs.uni-stuttgart.de

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 495 bytes
Desc: Message signed with OpenPGP using GPGMail
URL: <https://lists.dune-project.org/pipermail/dune-pdelab/attachments/20121219/a37abe5c/attachment.sig>


More information about the dune-pdelab mailing list