diff --git a/ChangeLog b/ChangeLog
index 82bb041..e653d82 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -82,15 +82,20 @@ CHANGELOG
--disambiguate=1, resembling the previous behaviour. Specifying the option
--disambiguate=0 allows to suppress whitespace insertion alltogether.
- Switched to Re2C V0.11.0
-- Added pragma option values push and pop to the opetions line, preserve and
- output allowing to store and restore the current option. The syntax is:
+- Added pragma option values push and pop to the line, preserve and output
+ options allowing to store and restore the current option. The syntax is:
#pragma wave options(: push) and
#pragma wave options( : pop)
where may be line, preserve or output. Thanks to Eric Niebler for
suggesting this feature.
- Added the possibility to use static pre-compiled DFA tables for the lexertl
based lexer.
-
+- Incorporated the changes from Andrei's latest version of the flex_string
+ class.
+- Added the is_macro_defined(name) function to the context object as described
+ in the documentation. This function is usable with any string type compatible
+ with std::string.
+
Boost V1.34.0
- Wave Version 1.2.4
- Added the possibility to explicitly enable/disable the generation of #line
@@ -249,9 +254,6 @@ Boost V1.34.0
generation of a #line directive.
- Worked around a linker issue for the True64/CXX compiler, complaining about
multiple defined symbols when using the flex_string class.
-- Added the is_macro_defined(name) function to the context object as described
- in the documentation. This function is usable with any string type compatible
- with std::string.
Sat Feb 18 2005
- Version 1.2.3
diff --git a/include/boost/wave/cpp_context.hpp b/include/boost/wave/cpp_context.hpp
index fc70d76..541c214 100644
--- a/include/boost/wave/cpp_context.hpp
+++ b/include/boost/wave/cpp_context.hpp
@@ -196,10 +196,7 @@ public:
is_predefined); }
template
bool is_defined_macro(StringT const &str)
- { return macros.is_defined(str.begin(), str.end()); }
- template
- bool is_defined_macro(IteratorT2 const &begin, IteratorT2 const &end)
- { return macros.is_defined(begin, end); }
+ { return macros.is_defined(str); }
bool get_macro_definition(typename token_type::string_type const &name,
bool &has_params, bool &is_predefined, position_type &pos,
std::vector ¶meters, token_sequence_type &definition)
@@ -258,6 +255,10 @@ protected:
boost::wave::context >;
#endif
+ template
+ bool is_defined_macro(IteratorT2 const &begin, IteratorT2 const &end)
+ { return macros.is_defined(begin, end); }
+
// maintain include paths (helper functions)
bool find_include_file (std::string &s, std::string &d, bool is_system,
char const *current_file) const
diff --git a/include/boost/wave/util/cpp_macromap.hpp b/include/boost/wave/util/cpp_macromap.hpp
index f15e122..84aaa11 100644
--- a/include/boost/wave/util/cpp_macromap.hpp
+++ b/include/boost/wave/util/cpp_macromap.hpp
@@ -99,8 +99,14 @@ public:
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
bool is_defined(IteratorT const &begin, IteratorT const &end);
+
+ // expects an arbitrary string as its parameter
+ template
+ 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 @@ token_id id = token_id(*begin);
}
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) {
@@ -405,6 +411,19 @@ typename defined_macros_type::iterator cit(current_macros -> find(name));
return cit != current_macros -> end();
}
+///////////////////////////////////////////////////////////////////////////////
+// same as above, only takes an arbitrary string type as its parameter
+template
+template
+inline bool
+macromap::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