diff --git a/include/boost/regex/v4/instances.hpp b/include/boost/regex/v4/instances.hpp index 8f07c252..d0238226 100644 --- a/include/boost/regex/v4/instances.hpp +++ b/include/boost/regex/v4/instances.hpp @@ -57,41 +57,23 @@ template class BOOST_REGEX_DECL reg_expression< BOOST_REGEX_CHAR_T >; #pragma option pop -#elif defined(BOOST_MSVC) +#elif defined(BOOST_MSVC) || defined(__GNUC__) # ifndef BOOST_REGEX_INSTANTIATE # define template extern template # endif -#pragma warning(push) -#pragma warning(disable : 4251 4231 4660) +# ifdef BOOST_MSVC +# pragma warning(push) +# pragma warning(disable : 4251 4231 4660) +# endif template class BOOST_REGEX_DECL reg_expression< BOOST_REGEX_CHAR_T >; -#pragma warning(pop) - -# ifdef template -# undef template +# ifdef BOOST_MSVC +# pragma warning(pop) # endif -#elif !defined(BOOST_REGEX_HAS_DLL_RUNTIME) - -// -// for each [member] function declare a full specialisation of that -// [member] function, then instantiate it in one translation unit. -// This is not guarenteed to work according to the standard, but in -// practice it should work for all compilers (unless they use a realy -// perverse name mangling convention). Unfortunately this approach -// does *not* work for Win32 style import/export, because that can -// alter the class layout. -// - -# ifndef BOOST_REGEX_INSTANTIATE -# define template template<> -# endif - -template unsigned int BOOST_REGEX_CALL reg_expression::set_expression(const BOOST_REGEX_CHAR_T* p, const BOOST_REGEX_CHAR_T* end, reg_expression::flag_type f); - # ifdef template # undef template # endif diff --git a/include/boost/regex/v4/match_flags.hpp b/include/boost/regex/v4/match_flags.hpp index b12c3519..28ad1065 100644 --- a/include/boost/regex/v4/match_flags.hpp +++ b/include/boost/regex/v4/match_flags.hpp @@ -123,6 +123,7 @@ using regex_constants::match_nosubs; using regex_constants::format_all; using regex_constants::format_sed; using regex_constants::format_perl; +using regex_constants::format_default; using regex_constants::format_no_copy; using regex_constants::format_first_only; //using regex_constants::format_is_if; diff --git a/include/boost/regex/v4/sub_match.hpp b/include/boost/regex/v4/sub_match.hpp index b74eb224..b67dd3ac 100644 --- a/include/boost/regex/v4/sub_match.hpp +++ b/include/boost/regex/v4/sub_match.hpp @@ -51,16 +51,16 @@ struct sub_match : public std::pair } difference_type BOOST_REGEX_CALL length()const { - difference_type n = boost::re_detail::distance((BidiIterator)first, (BidiIterator)second); + difference_type n = boost::re_detail::distance((BidiIterator)this->first, (BidiIterator)this->second); return n; } std::basic_string str()const { std::basic_string result; - std::size_t len = boost::re_detail::distance((BidiIterator)first, (BidiIterator)second); + std::size_t len = boost::re_detail::distance((BidiIterator)this->first, (BidiIterator)this->second); result.reserve(len); - BidiIterator i = first; - while(i != second) + BidiIterator i = this->first; + while(i != this->second) { result.append(1, *i); ++i;