'How to extend mpz_class in c++

I want to create my own class that is similar to mpz_class except has a few extra methods. I have however heard it is not a good idea to extend std classes. Does this advice apply here or can I safely do:

class MyBigInt : public mpz_class {
public:
    long double specialMethod() {
        //do something that returns a long double
    }
}

The reason I am interested in extending is I still want the ability to do

mpz_class a,b,c;
a=5;
b=6;
c=a+b;

so if extending is a bad idea I need to some how figure out how to make the above work with my own class.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source