template <class T>
inline bool is_a(const basic &obj)
{
- return dynamic_cast<const T *>(&obj) != 0;
+ return dynamic_cast<const T *>(&obj) != nullptr;
}
/** Check if obj is a T, not including base classes. */
// public
-constant::constant() : ef(0), serial(next_serial++), domain(domain::complex)
+constant::constant() : ef(nullptr), serial(next_serial++), domain(domain::complex)
{
setflag(status_flags::evaluated | status_flags::expanded);
}
}
constant::constant(const std::string & initname, const numeric & initnumber, const std::string & texname, unsigned dm)
- : name(initname), ef(0), number(initnumber), serial(next_serial++), domain(dm)
+ : name(initname), ef(nullptr), number(initnumber), serial(next_serial++), domain(dm)
{
if (texname.empty())
TeX_name = "\\mathrm{" + name + "}";
ex constant::evalf(int level) const
{
- if (ef!=0) {
+ if (ef!=nullptr) {
return ef();
} else {
return number.evalf();
GINAC_DECLARE_REGISTERED_CLASS(constant, basic)
// other constructors
public:
- constant(const std::string & initname, evalffunctype efun = 0, const std::string & texname = std::string(), unsigned domain = domain::complex);
+ constant(const std::string & initname, evalffunctype efun = nullptr, const std::string & texname = std::string(), unsigned domain = domain::complex);
constant(const std::string & initname, const numeric & initnumber, const std::string & texname = std::string(), unsigned domain = domain::complex);
// functions overriding virtual functions from base classes
set_name("unnamed_function", "\\\\mbox{unnamed}");
nparams = 0;
eval_f = evalf_f = real_part_f = imag_part_f = conjugate_f = expand_f
- = derivative_f = expl_derivative_f = power_f = series_f = 0;
+ = derivative_f = expl_derivative_f = power_f = series_f = nullptr;
info_f = 0;
evalf_params_first = true;
use_return_type = false;
}
}
- if (opt.eval_f==0) {
+ if (opt.eval_f==nullptr) {
return this->hold();
}
return *this;
}
- function_options & set_return_type(unsigned rt, const return_type_t* rtt = 0);
+ function_options & set_return_type(unsigned rt, const return_type_t* rtt = nullptr);
function_options & do_not_evalf_params();
function_options & remember(unsigned size, unsigned assoc_size=0,
unsigned strategy=remember_strategies::delete_never);
static void set_print_options(std::ostream & s, unsigned options)
{
print_context *p = get_print_context(s);
- if (p == 0)
+ if (p == nullptr)
set_print_context(s, print_dflt(s, options));
else
p->options = options;
std::ostream & operator<<(std::ostream & os, const ex & e)
{
print_context *p = get_print_context(os);
- if (p == 0)
+ if (p == nullptr)
e.print(print_dflt(os));
else
e.print(*p);
os << "[";
while (true) {
- if (p == 0)
+ if (p == nullptr)
i -> print(print_dflt(os));
else
i -> print(*p);
os << "<";
while (true) {
- if (p == 0)
+ if (p == nullptr)
i->print(print_dflt(os));
else
i->print(*p);
os << "{";
while (true) {
- if (p == 0)
+ if (p == nullptr)
i->first.print(print_dflt(os));
else
i->first.print(*p);
os << "==";
- if (p == 0)
+ if (p == nullptr)
i->second.print(print_dflt(os));
else
i->second.print(*p);
namespace GiNaC {
-bool normalize_in_field(umodpoly& a, cln::cl_MI* content_ = 0);
+bool normalize_in_field(umodpoly& a, cln::cl_MI* content_ = nullptr);
/// Make the univariate polynomial @a x unit normal. This version is used
/// for rings which are not fields.
/// Returns true if the polynomial @x is already unit normal, and false
/// otherwise.
template<typename T> bool
-normalize_in_ring(T& x, typename T::value_type* content_ = 0, int* unit_ = 0)
+normalize_in_ring(T& x, typename T::value_type* content_ = nullptr, int* unit_ = nullptr)
{
typedef typename T::value_type ring_t;
static const ring_t one(1);
/** Check if obj is a T, including base classes. */
template <class T>
inline bool is_a(const print_context & obj)
-{ return dynamic_cast<const T *>(&obj) != 0; }
+{ return dynamic_cast<const T *>(&obj) != nullptr; }
class basic;
{
if (this != &other) {
print_functor_impl *p = other.impl.get();
- impl.reset(p ? other.impl->duplicate() : 0);
+ impl.reset(p ? other.impl->duplicate() : nullptr);
}
return *this;
}