]> www.ginac.de Git - ginac.git/blobdiff - ginac/container.pl
- added lst::remove_first() and lst::remove_last()
[ginac.git] / ginac / container.pl
index 480d5a565cd32caad51a9b4011dc3a1d54ca811c..275461557c4f7d2aaa460ae47ef0ce69de38e13e 100755 (executable)
@@ -54,6 +54,7 @@ if ($reserve) {
 if ($prepend) {
        $PREPEND_INTERFACE=<<END_OF_PREPEND_INTERFACE;
        virtual ${CONTAINER} & prepend(const ex & b);
+       virtual ${CONTAINER} & remove_first(void);
 END_OF_PREPEND_INTERFACE
 
        $PREPEND_IMPLEMENTATION=<<END_OF_PREPEND_IMPLEMENTATION;
@@ -63,6 +64,12 @@ ${CONTAINER} & ${CONTAINER}::prepend(const ex & b)
        seq.push_front(b);
        return *this;
 }
+${CONTAINER} & ${CONTAINER}::remove_first(void)
+{
+       ensure_if_modifiable();
+       seq.pop_front();
+       return *this;
+}
 END_OF_PREPEND_IMPLEMENTATION
 } else {
        $PREPEND_INTERFACE="    // no prepend possible for ${CONTAINER}";
@@ -217,6 +224,7 @@ protected:
        // new virtual functions which can be overridden by derived classes
 public:
        virtual ${CONTAINER} & append(const ex & b);
+       virtual ${CONTAINER} & remove_last(void);
 ${PREPEND_INTERFACE}
 protected:
        virtual void printseq(const print_context & c, char openbracket, char delim,
@@ -540,6 +548,13 @@ ${CONTAINER} & ${CONTAINER}::append(const ex & b)
        return *this;
 }
 
+${CONTAINER} & ${CONTAINER}::remove_last(void)
+{
+       ensure_if_modifiable();
+       seq.pop_back();
+       return *this;
+}
+
 ${PREPEND_IMPLEMENTATION}
 
 // protected