- basic * duplicate() const;
- void printraw(ostream & os) const;
- void print(ostream & os, unsigned upper_precedence=0) const;
- void printtree(ostream & os, unsigned indent) const;
- void printcsrc(ostream & os, unsigned type, unsigned upper_precedence=0) const;
+ /** Construct structure as a copy of a given C++ structure. */
+ structure(const T & t) : obj(t) { }
+
+ // functions overriding virtual functions from base classes
+ // All these are just defaults that can be specialized by the user
+public:
+ // evaluation
+ ex eval() const override { return hold(); }
+ ex evalm() const override { return inherited::evalm(); }
+protected:
+ ex eval_ncmul(const exvector & v) const override { return hold_ncmul(v); }
+public:
+ ex eval_indexed(const basic & i) const override { return i.hold(); }
+
+ // printing
+ void print(const print_context & c, unsigned level = 0) const override { inherited::print(c, level); }
+ unsigned precedence() const override { return 70; }
+
+ // info
+ bool info(unsigned inf) const override { return false; }
+
+ // operand access
+ size_t nops() const override { return 0; }
+ ex op(size_t i) const override { return inherited::op(i); }
+ ex operator[](const ex & index) const override { return inherited::operator[](index); }
+ ex operator[](size_t i) const override { return inherited::operator[](i); }
+ ex & let_op(size_t i) override { return inherited::let_op(i); }
+ ex & operator[](const ex & index) override { return inherited::operator[](index); }
+ ex & operator[](size_t i) override { return inherited::operator[](i); }
+
+ // pattern matching
+ bool has(const ex & other, unsigned options = 0) const override { return inherited::has(other, options); }
+ bool match(const ex & pattern, exmap& repl_lst) const override { return inherited::match(pattern, repl_lst); }