diff options
author | Daniel Burrows <dburrows@debian.org> | 2009-05-26 07:59:12 -0700 |
---|---|---|
committer | Daniel Burrows <dburrows@debian.org> | 2009-05-26 07:59:12 -0700 |
commit | 44553f7e410fd1cdba1f29f810c273dcb51ed482 (patch) | |
tree | 63b8912df09608fad86a55c414e822dd9b63f258 /src/generic/problemresolver/incremental_expression.h | |
parent | 965157a89f291092aa2251c7168bac0cb5d872bb (diff) | |
download | aptitude-44553f7e410fd1cdba1f29f810c273dcb51ed482.tar.gz |
Add a default implementation of dump() in expression_box.
Diffstat (limited to 'src/generic/problemresolver/incremental_expression.h')
-rw-r--r-- | src/generic/problemresolver/incremental_expression.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/generic/problemresolver/incremental_expression.h b/src/generic/problemresolver/incremental_expression.h index 6391c4c1..6fb4f351 100644 --- a/src/generic/problemresolver/incremental_expression.h +++ b/src/generic/problemresolver/incremental_expression.h @@ -312,6 +312,17 @@ public: else return T(); } + + /** \brief Write this expression to the given stream. + * + * The default implementation writes nothing if the child is + * invalid, and writes the child if the child is valid. + */ + void dump(std::ostream &out) + { + if(get_child().valid()) + get_child()->dump(out); + } }; /** \brief Base class for N-ary containers that support adding and |