]> www.ginac.de Git - ginac.git/commitdiff
symmetry::compare_same_type(): const-correctness fix
authorJan Rheinländer <jrheinlaender@gmx.de>
Mon, 20 Sep 2010 11:16:47 +0000 (11:16 +0000)
committerAlexei Sheplyakov <Alexei.Sheplyakov@gmail.com>
Fri, 26 Nov 2010 22:15:55 +0000 (00:15 +0200)
The method in question is const, therefore one should use const_iterator
to access indices. Some compilers (for instance, msvc) are very strict
about this, and won't accept (invalid) code using non-const iterator.

ginac/symmetry.cpp

index 23f9df903b98bd1d12a4f60532e6809b69d5ac23..5dd974c2921370085fd992ae9157e5d4fd551d99 100644 (file)
@@ -160,7 +160,7 @@ int symmetry::compare_same_type(const basic & other) const
                return 1;
        if (this_size < that_size)
                return -1;
-       typedef std::set<unsigned>::iterator set_it;
+       typedef std::set<unsigned>::const_iterator set_it;
        set_it end = indices.end();
        for (set_it i=indices.begin(),j=othersymm.indices.begin(); i!=end; ++i,++j) {
                if(*i < *j)