* Definition of helper classes for expression output. */
/*
- * GiNaC Copyright (C) 1999-2015 Johannes Gutenberg University Mainz, Germany
+ * GiNaC Copyright (C) 1999-2016 Johannes Gutenberg University Mainz, Germany
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
/** 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;
typedef void (*F)(const T &, const C &, unsigned);
print_ptrfun_handler(F f_) : f(f_) {}
- print_ptrfun_handler *duplicate() const { return new print_ptrfun_handler(*this); }
+ print_ptrfun_handler *duplicate() const override { return new print_ptrfun_handler(*this); }
- void operator()(const basic & obj, const print_context & c, unsigned level) const
+ void operator()(const basic & obj, const print_context & c, unsigned level) const override
{
// Call the supplied function
f(dynamic_cast<const T &>(obj), dynamic_cast<const C &>(c), level);
typedef void (T::*F)(const C & c, unsigned level) const;
print_memfun_handler(F f_) : f(f_) {}
- print_memfun_handler *duplicate() const { return new print_memfun_handler(*this); }
+ print_memfun_handler *duplicate() const override { return new print_memfun_handler(*this); }
- void operator()(const basic & obj, const print_context & c, unsigned level) const
+ void operator()(const basic & obj, const print_context & c, unsigned level) const override
{
// Call the supplied member function
return (dynamic_cast<const T &>(obj).*f)(dynamic_cast<const C &>(c), level);
{
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;
}