X-Git-Url: https://www.ginac.de/ginac.git//ginac.git?p=ginac.git;a=blobdiff_plain;f=ginac%2Fbasic.cpp;h=1aff2e16671edfbd530c06dd6e0392ee35902b01;hp=8baa3536a83d296e78facabc7436d4cdefa46a2e;hb=28e5e38935cc32a4e5f8995645f92f12fedcdaf5;hpb=11c7f91bf740646e78ffa0711ef405aefca96705 diff --git a/ginac/basic.cpp b/ginac/basic.cpp index 8baa3536..1aff2e16 100644 --- a/ginac/basic.cpp +++ b/ginac/basic.cpp @@ -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(*index.bp).to_int()); - + if (is_ex_exactly_of_type(index,numeric)) + return op(ex_to(index).to_int()); + throw(std::invalid_argument("non-numeric indices not supported by this type")); }