From 44553f7e410fd1cdba1f29f810c273dcb51ed482 Mon Sep 17 00:00:00 2001 From: Daniel Burrows Date: Tue, 26 May 2009 07:59:12 -0700 Subject: Add a default implementation of dump() in expression_box. --- src/generic/problemresolver/incremental_expression.h | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src/generic/problemresolver/incremental_expression.h') 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 -- cgit v1.2.3