Class ExprPtr¶
Defined in File expr.hpp
Inheritance Relationships¶
Base Type¶
public std::shared_ptr< Expr >
Class Documentation¶
-
class ExprPtr : public std::shared_ptr<Expr>¶
ExprPtr is a multiple-owner smart pointer to Expr.
It can be used mostly interchangeably with
std::shared_ptr<Expr>
, but also provides convenient mathematical operators (+=
, etc.)Public Functions
-
ExprPtr() = default¶
-
~ExprPtr() = default¶
-
ExprPtr clone() && noexcept¶
Note
this object is null after the call
- Returns:
a moved copy of this object
-
Expr &operator*() &¶
dereference operator
- Returns:
non-const lvalue reference to the contained Expr object
- Pre:
this->operator bool()
-
const Expr &operator*() const &¶
dereference operator
- Returns:
const lvalue reference to the contained Expr object
- Pre:
this->operator bool()
-
Expr &&operator*() &&¶
dereference operator
- Returns:
non-const rvalue reference to the contained Expr object
- Pre:
this->operator bool()
-
ExprPtr &operator+=(const ExprPtr &other)¶
in-place addition operator
if this is non-null, adds
other
to the contained expressions, otherwise will make this point to a clone ofother
(see Expr::clone())- Parameters:
other – expression to add to this
- Returns:
reference to
*this
-
ExprPtr &operator-=(const ExprPtr&)¶
in-place subtraction operator
if this is non-null, subtracts
other
from the contained expressions, otherwise will make this point to the negative of a clone ofother
(see Expr::clone())- Parameters:
other – expression to add to this
- Returns:
reference to
*this
-
ExprPtr &operator*=(const ExprPtr&)¶
in-place multiplication operator
if this is non-null, multiplies the contained expressions by
other
, otherwise will make this point to a clone ofother
(see Expr::clone())- Parameters:
other – expression to add to this
- Returns:
reference to
*this
-
template<typename T>
bool is() const¶ - Template Parameters:
T – an Expr type
- Returns:
true if this object is of type
T
-
template<typename T>
const T &as() const¶ - Template Parameters:
T – an Expr type
- Returns:
this object cast to type
T
-
template<typename T>
T &as()¶ - Template Parameters:
T – an Expr type
- Returns:
this object cast to type
T
-
std::wstring to_latex() const¶
-
ExprPtr() = default¶