]> www.ginac.de Git - ginac.git/blobdiff - ginac/mul.cpp
A better return_type_tinfo() mechanism.
[ginac.git] / ginac / mul.cpp
index 63f92e1492d4fae3af2d8467f66793b0cc40bb68..96b965d1c5d4fd996f54b2ea7d33ed583c163349 100644 (file)
@@ -855,10 +855,10 @@ unsigned mul::return_type() const
        return all_commutative ? return_types::commutative : return_types::noncommutative;
 }
    
-tinfo_t mul::return_type_tinfo() const
+return_type_t mul::return_type_tinfo() const
 {
        if (seq.empty())
-               return this;  // mul without factors: should not happen
+               return make_return_type_t<mul>(); // mul without factors: should not happen
        
        // return type_info of first noncommutative element
        epvector::const_iterator i = seq.begin(), end = seq.end();
@@ -868,7 +868,7 @@ tinfo_t mul::return_type_tinfo() const
                ++i;
        }
        // no noncommutative element found, should not happen
-       return this;
+       return make_return_type_t<mul>();
 }
 
 ex mul::thisexpairseq(const epvector & v, const ex & oc, bool do_index_renaming) const