Update of /cvsroot/boost/boost/boost/wave/util
In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv1875/boost/wave/util
Modified Files:
cpp_macromap.hpp
Log Message:
Wave: Fixed the is_defined() issue.
Index: cpp_macromap.hpp
===================================================================
RCS file: /cvsroot/boost/boost/boost/wave/util/cpp_macromap.hpp,v
retrieving revision 1.33
retrieving revision 1.34
diff -u -d -r1.33 -r1.34
--- cpp_macromap.hpp 6 Mar 2007 19:08:23 -0000 1.33
+++ cpp_macromap.hpp 8 Mar 2007 14:04:37 -0000 1.34
@@ -99,8 +99,14 @@
bool is_defined(string_type const &name,
typename defined_macros_type::iterator &it,
defined_macros_type *scope = 0) const;
+
+ // expects a token sequence as its parameters
template <typename IteratorT>
bool is_defined(IteratorT const &begin, IteratorT const &end);
+
+ // expects an arbitrary string as its parameter
+ template<typename StringT>
+ bool is_defined(StringT const &str);
// Get the macro definition for the given macro scope
bool get_macro(string_type const &name, bool &has_parameters,
@@ -393,7 +399,7 @@
}
IteratorT it = begin;
-string_type name ((*it).get_value().c_str());
+string_type name ((*it).get_value());
typename defined_macros_type::iterator cit(current_macros -> find(name));
if (++it != end) {
@@ -406,6 +412,19 @@
}
///////////////////////////////////////////////////////////////////////////////
+// same as above, only takes an arbitrary string type as its parameter
+template <typename ContextT>
+template<typename StringT>
+inline bool
+macromap<ContextT>::is_defined(StringT const &str)
+{
+string_type name (str.c_str());
+typename defined_macros_type::iterator cit(current_macros -> find(name));
+
+ return cit != current_macros -> end();
+}
+
+///////////////////////////////////////////////////////////////////////////////
//
// Get the macro definition for the given macro scope
//
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Boost-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/boost-cvs