diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2009-12-10 10:13:55 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2009-12-10 10:13:55 +0200 |
commit | 4ad81437b15fc6856f9848a1d3e795b1cf78030f (patch) | |
tree | 7e9efd6e66fc7061335991aa3ec5a08757c22c74 /cli/context.hxx | |
parent | b6bad2f5ed83ea08a596dc0d39b6b134357b04a6 (diff) |
Get rid of warning in generated code if option class is empty
Diffstat (limited to 'cli/context.hxx')
-rw-r--r-- | cli/context.hxx | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/cli/context.hxx b/cli/context.hxx index 2b0c128..8f9b659 100644 --- a/cli/context.hxx +++ b/cli/context.hxx @@ -113,6 +113,20 @@ private: operator= (context const&); }; +// Checks if scope Y names any of X. +// +template <typename X, typename Y> +bool +has (Y& y) +{ + for (semantics::scope::names_iterator i (y.names_begin ()), + e (y.names_end ()); i != e; ++i) + if (i->named ().is_a<X> ()) + return true; + + return false; +} + // Standard namespace traverser. // struct namespace_: traversal::namespace_, context |