mirror of
https://github.com/boostorg/regex.git
synced 2025-07-15 21:32:18 +02:00
Removed external templates for unknown compilers.
Fixed std conformance bugs in v4 code (shown up by metrowerks compiler). [SVN r18467]
This commit is contained in:
@ -57,41 +57,23 @@ template class BOOST_REGEX_DECL reg_expression< BOOST_REGEX_CHAR_T >;
|
|||||||
|
|
||||||
#pragma option pop
|
#pragma option pop
|
||||||
|
|
||||||
#elif defined(BOOST_MSVC)
|
#elif defined(BOOST_MSVC) || defined(__GNUC__)
|
||||||
|
|
||||||
# ifndef BOOST_REGEX_INSTANTIATE
|
# ifndef BOOST_REGEX_INSTANTIATE
|
||||||
# define template extern template
|
# define template extern template
|
||||||
# endif
|
# endif
|
||||||
|
|
||||||
#pragma warning(push)
|
# ifdef BOOST_MSVC
|
||||||
#pragma warning(disable : 4251 4231 4660)
|
# pragma warning(push)
|
||||||
|
# pragma warning(disable : 4251 4231 4660)
|
||||||
|
# endif
|
||||||
|
|
||||||
template class BOOST_REGEX_DECL reg_expression< BOOST_REGEX_CHAR_T >;
|
template class BOOST_REGEX_DECL reg_expression< BOOST_REGEX_CHAR_T >;
|
||||||
|
|
||||||
#pragma warning(pop)
|
# ifdef BOOST_MSVC
|
||||||
|
# pragma warning(pop)
|
||||||
# ifdef template
|
|
||||||
# undef template
|
|
||||||
# endif
|
# 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<BOOST_REGEX_CHAR_T>::set_expression(const BOOST_REGEX_CHAR_T* p, const BOOST_REGEX_CHAR_T* end, reg_expression<BOOST_REGEX_CHAR_T>::flag_type f);
|
|
||||||
|
|
||||||
# ifdef template
|
# ifdef template
|
||||||
# undef template
|
# undef template
|
||||||
# endif
|
# endif
|
||||||
|
@ -123,6 +123,7 @@ using regex_constants::match_nosubs;
|
|||||||
using regex_constants::format_all;
|
using regex_constants::format_all;
|
||||||
using regex_constants::format_sed;
|
using regex_constants::format_sed;
|
||||||
using regex_constants::format_perl;
|
using regex_constants::format_perl;
|
||||||
|
using regex_constants::format_default;
|
||||||
using regex_constants::format_no_copy;
|
using regex_constants::format_no_copy;
|
||||||
using regex_constants::format_first_only;
|
using regex_constants::format_first_only;
|
||||||
//using regex_constants::format_is_if;
|
//using regex_constants::format_is_if;
|
||||||
|
@ -51,16 +51,16 @@ struct sub_match : public std::pair<BidiIterator, BidiIterator>
|
|||||||
}
|
}
|
||||||
difference_type BOOST_REGEX_CALL length()const
|
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;
|
return n;
|
||||||
}
|
}
|
||||||
std::basic_string<value_type> str()const
|
std::basic_string<value_type> str()const
|
||||||
{
|
{
|
||||||
std::basic_string<value_type> result;
|
std::basic_string<value_type> 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);
|
result.reserve(len);
|
||||||
BidiIterator i = first;
|
BidiIterator i = this->first;
|
||||||
while(i != second)
|
while(i != this->second)
|
||||||
{
|
{
|
||||||
result.append(1, *i);
|
result.append(1, *i);
|
||||||
++i;
|
++i;
|
||||||
|
Reference in New Issue
Block a user