#ifndef __rf_box_ih__ #define __rf_box_ih__ #include "rf_box.hh" #include "rf_object.ih" #include "rf_expr.ih" #include namespace rfrt { extern const Expr empty ; } namespace rftype { using rfrt::empty ; inline Box::Box () : content (empty) {} inline Box::Box (Expr const& _expr) : content (_expr) {} inline Box::Box (Box const& _box) : Object (), content (_box.content) {} inline Box& Box::operator = (Box const& _box) { if (this != &_box) { this->~Box(); new(this) Box(_box); } return self; } inline unsigned Box::get_type () const { return reg.get_type(); } inline uint32_t Box::hash () const { return content.hash(); } inline bool Box::operator == (Object const& _obj) const { try { Box const& b = dynamic_cast(_obj); return content == b.content; } catch (std::bad_cast&) { return false; } } inline void Box::put (Expr const& _expr) { content = _expr; } inline Expr Box::get () { return content; } } #endif // __rf_box_ih__