From 4ad81437b15fc6856f9848a1d3e795b1cf78030f Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Thu, 10 Dec 2009 10:13:55 +0200 Subject: Get rid of warning in generated code if option class is empty --- cli/context.hxx | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'cli/context.hxx') 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 +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 ()) + return true; + + return false; +} + // Standard namespace traverser. // struct namespace_: traversal::namespace_, context -- cgit v1.1