diff options
Diffstat (limited to 'cutl/compiler/traversal.hxx')
-rw-r--r-- | cutl/compiler/traversal.hxx | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/cutl/compiler/traversal.hxx b/cutl/compiler/traversal.hxx index 44fd3e6..58e8896 100644 --- a/cutl/compiler/traversal.hxx +++ b/cutl/compiler/traversal.hxx @@ -36,7 +36,19 @@ namespace cutl { public: typedef std::vector<traverser<B>*> traversers; - typedef std::map<type_id, traversers> map_type; + + struct map_type: std::map<type_id, traversers> + { + map_type () {} + + // Don't copy traverser maps. We do it here instead of in + // traverser_map to pacify GCC's -Wextra insisting we must + // explicitly initialize virtual bases in copy constructor. + // + map_type (map_type const&): std::map<type_id, traversers> () {} + map_type& operator= (map_type const&) {return *this;} + }; + typedef typename map_type::const_iterator iterator; iterator @@ -76,6 +88,11 @@ namespace cutl add (typeid (type), *this); } + traverser_impl (traverser_impl const&) + { + add (typeid (type), *this); + } + virtual void traverse (type&) = 0; |