]> www.ginac.de Git - ginac.git/blobdiff - ginac/basic.cpp
- carried on with felonious plot about making ex::bp private.
[ginac.git] / ginac / basic.cpp
index 8baa3536a83d296e78facabc7436d4cdefa46a2e..1aff2e16671edfbd530c06dd6e0392ee35902b01 100644 (file)
@@ -196,9 +196,9 @@ ex & basic::let_op(int i)
 
 ex basic::operator[](const ex & index) const
 {
-       if (is_exactly_of_type(*index.bp,numeric))
-               return op(static_cast<const numeric &>(*index.bp).to_int());
-       
+       if (is_ex_exactly_of_type(index,numeric))
+               return op(ex_to<numeric>(index).to_int());
+
        throw(std::invalid_argument("non-numeric indices not supported by this type"));
 }