public:
// types:
typedef _Ch_type value_type;
+ typedef _Rx_traits traits_type;
+ typedef typename traits_type::string_type string_type;
typedef regex_constants::syntax_option_type flag_type;
- typedef typename _Rx_traits::locale_type locale_type;
- typedef typename _Rx_traits::string_type string_type;
+ typedef typename traits_type::locale_type locale_type;
/**
* @name Constants
*
* @param rhs A @p regex object.
*/
- basic_regex(const basic_regex&& __rhs)
+ basic_regex(const basic_regex&& __rhs) noexcept
: _M_flags(__rhs._M_flags), _M_traits(__rhs._M_traits),
_M_automaton(std::move(__rhs._M_automaton))
{ }
* @brief Move-assigns one regular expression to another.
*/
basic_regex&
- operator=(basic_regex&& __rhs)
+ operator=(basic_regex&& __rhs) noexcept
{ return this->assign(std::move(__rhs)); }
/**
* @param rhs Another regular expression object.
*/
basic_regex&
- assign(basic_regex&& __rhs)
+ assign(basic_regex&& __rhs) noexcept
{
basic_regex __tmp(std::move(__rhs));
this->swap(__tmp);
typename iterator_traits<_Bi_iter>::value_type,
_Ch_traits, _Ch_alloc>& __lhs,
const sub_match<_Bi_iter>& __rhs)
- { return __lhs == __rhs.str(); }
+ { return __rhs.compare(__lhs.c_str()) == 0; }
/**
* @brief Tests the inequivalence of a string and a regular expression
operator!=(const basic_string<
typename iterator_traits<_Bi_iter>::value_type,
_Ch_traits, _Ch_alloc>& __lhs, const sub_match<_Bi_iter>& __rhs)
- { return __lhs != __rhs.str(); }
+ { return !(__lhs == __rhs); }
/**
* @brief Tests the ordering of a string and a regular expression submatch.
operator<(const basic_string<
typename iterator_traits<_Bi_iter>::value_type,
_Ch_traits, _Ch_alloc>& __lhs, const sub_match<_Bi_iter>& __rhs)
- { return __lhs < __rhs.str(); }
+ { return __rhs.compare(__lhs.c_str()) > 0; }
/**
* @brief Tests the ordering of a string and a regular expression submatch.
operator>(const basic_string<
typename iterator_traits<_Bi_iter>::value_type,
_Ch_traits, _Ch_alloc>& __lhs, const sub_match<_Bi_iter>& __rhs)
- { return __lhs > __rhs.str(); }
+ { return __rhs < __lhs; }
/**
* @brief Tests the ordering of a string and a regular expression submatch.
operator>=(const basic_string<
typename iterator_traits<_Bi_iter>::value_type,
_Ch_traits, _Ch_alloc>& __lhs, const sub_match<_Bi_iter>& __rhs)
- { return __lhs >= __rhs.str(); }
+ { return !(__lhs < __rhs); }
/**
* @brief Tests the ordering of a string and a regular expression submatch.
operator<=(const basic_string<
typename iterator_traits<_Bi_iter>::value_type,
_Ch_traits, _Ch_alloc>& __lhs, const sub_match<_Bi_iter>& __rhs)
- { return __lhs <= __rhs.str(); }
+ { return !(__rhs < __lhs); }
/**
* @brief Tests the equivalence of a regular expression submatch and a
const basic_string<
typename iterator_traits<_Bi_iter>::value_type,
_Ch_traits, _Ch_alloc>& __rhs)
- { return __lhs.str() == __rhs; }
+ { return __lhs.compare(__rhs.c_str()) == 0; }
/**
* @brief Tests the inequivalence of a regular expression submatch and a
const basic_string<
typename iterator_traits<_Bi_iter>::value_type,
_Ch_traits, _Ch_alloc>& __rhs)
- { return __lhs.str() != __rhs; }
+ { return !(__lhs == __rhs); }
/**
* @brief Tests the ordering of a regular expression submatch and a string.
const basic_string<
typename iterator_traits<_Bi_iter>::value_type,
_Ch_traits, _Ch_alloc>& __rhs)
- { return __lhs.str() < __rhs; }
+ { return __lhs.compare(__rhs.c_str()) < 0; }
/**
* @brief Tests the ordering of a regular expression submatch and a string.
const basic_string<
typename iterator_traits<_Bi_iter>::value_type,
_Ch_traits, _Ch_alloc>& __rhs)
- { return __lhs.str() > __rhs; }
+ { return __rhs < __lhs; }
/**
* @brief Tests the ordering of a regular expression submatch and a string.
const basic_string<
typename iterator_traits<_Bi_iter>::value_type,
_Ch_traits, _Ch_alloc>& __rhs)
- { return __lhs.str() >= __rhs; }
+ { return !(__lhs < __rhs); }
/**
* @brief Tests the ordering of a regular expression submatch and a string.
const basic_string<
typename iterator_traits<_Bi_iter>::value_type,
_Ch_traits, _Ch_alloc>& __rhs)
- { return __lhs.str() <= __rhs; }
+ { return !(__rhs < __lhs); }
/**
* @brief Tests the equivalence of a C string and a regular expression
inline bool
operator==(typename iterator_traits<_Bi_iter>::value_type const* __lhs,
const sub_match<_Bi_iter>& __rhs)
- { return __lhs == __rhs.str(); }
+ { return __rhs.compare(__lhs) == 0; }
/**
* @brief Tests the inequivalence of an iterator value and a regular
inline bool
operator!=(typename iterator_traits<_Bi_iter>::value_type const* __lhs,
const sub_match<_Bi_iter>& __rhs)
- { return __lhs != __rhs.str(); }
+ { return !(__lhs == __rhs); }
/**
* @brief Tests the ordering of a string and a regular expression submatch.
inline bool
operator<(typename iterator_traits<_Bi_iter>::value_type const* __lhs,
const sub_match<_Bi_iter>& __rhs)
- { return __lhs < __rhs.str(); }
+ { return __rhs.compare(__lhs) > 0; }
/**
* @brief Tests the ordering of a string and a regular expression submatch.
inline bool
operator>(typename iterator_traits<_Bi_iter>::value_type const* __lhs,
const sub_match<_Bi_iter>& __rhs)
- { return __lhs > __rhs.str(); }
+ { return __rhs < __lhs; }
/**
* @brief Tests the ordering of a string and a regular expression submatch.
inline bool
operator>=(typename iterator_traits<_Bi_iter>::value_type const* __lhs,
const sub_match<_Bi_iter>& __rhs)
- { return __lhs >= __rhs.str(); }
+ { return !(__lhs < __rhs); }
/**
* @brief Tests the ordering of a string and a regular expression submatch.
inline bool
operator<=(typename iterator_traits<_Bi_iter>::value_type const* __lhs,
const sub_match<_Bi_iter>& __rhs)
- { return __lhs <= __rhs.str(); }
+ { return !(__rhs < __lhs); }
/**
* @brief Tests the equivalence of a regular expression submatch and a
inline bool
operator==(const sub_match<_Bi_iter>& __lhs,
typename iterator_traits<_Bi_iter>::value_type const* __rhs)
- { return __lhs.str() == __rhs; }
+ { return __lhs.compare(__rhs) == 0; }
/**
* @brief Tests the inequivalence of a regular expression submatch and a
inline bool
operator!=(const sub_match<_Bi_iter>& __lhs,
typename iterator_traits<_Bi_iter>::value_type const* __rhs)
- { return __lhs.str() != __rhs; }
+ { return !(__lhs == __rhs); }
/**
* @brief Tests the ordering of a regular expression submatch and a string.
inline bool
operator<(const sub_match<_Bi_iter>& __lhs,
typename iterator_traits<_Bi_iter>::value_type const* __rhs)
- { return __lhs.str() < __rhs; }
+ { return __lhs.compare(__rhs) < 0; }
/**
* @brief Tests the ordering of a regular expression submatch and a string.
inline bool
operator>(const sub_match<_Bi_iter>& __lhs,
typename iterator_traits<_Bi_iter>::value_type const* __rhs)
- { return __lhs.str() > __rhs; }
+ { return __rhs < __lhs; }
/**
* @brief Tests the ordering of a regular expression submatch and a string.
inline bool
operator>=(const sub_match<_Bi_iter>& __lhs,
typename iterator_traits<_Bi_iter>::value_type const* __rhs)
- { return __lhs.str() >= __rhs; }
+ { return !(__lhs < __rhs); }
/**
* @brief Tests the ordering of a regular expression submatch and a string.
inline bool
operator<=(const sub_match<_Bi_iter>& __lhs,
typename iterator_traits<_Bi_iter>::value_type const* __rhs)
- { return __lhs.str() <= __rhs; }
+ { return !(__rhs < __lhs); }
/**
* @brief Tests the equivalence of a string and a regular expression
inline bool
operator==(typename iterator_traits<_Bi_iter>::value_type const& __lhs,
const sub_match<_Bi_iter>& __rhs)
- { return __lhs == __rhs.str(); }
+ {
+ return __rhs.compare(typename sub_match<_Bi_iter>::string_type(1, __lhs))
+ == 0;
+ }
/**
* @brief Tests the inequivalence of a string and a regular expression
inline bool
operator!=(typename iterator_traits<_Bi_iter>::value_type const& __lhs,
const sub_match<_Bi_iter>& __rhs)
- { return __lhs != __rhs.str(); }
+ { return !(__lhs == __rhs); }
/**
* @brief Tests the ordering of a string and a regular expression submatch.
inline bool
operator<(typename iterator_traits<_Bi_iter>::value_type const& __lhs,
const sub_match<_Bi_iter>& __rhs)
- { return __lhs < __rhs.str(); }
+ {
+ return __rhs.compare(typename sub_match<_Bi_iter>::string_type(1, __lhs))
+ > 0;
+ }
/**
* @brief Tests the ordering of a string and a regular expression submatch.
inline bool
operator>(typename iterator_traits<_Bi_iter>::value_type const& __lhs,
const sub_match<_Bi_iter>& __rhs)
- { return __lhs > __rhs.str(); }
+ { return __rhs < __lhs; }
/**
* @brief Tests the ordering of a string and a regular expression submatch.
inline bool
operator>=(typename iterator_traits<_Bi_iter>::value_type const& __lhs,
const sub_match<_Bi_iter>& __rhs)
- { return __lhs >= __rhs.str(); }
+ { return !(__lhs < __rhs); }
/**
* @brief Tests the ordering of a string and a regular expression submatch.
inline bool
operator<=(typename iterator_traits<_Bi_iter>::value_type const& __lhs,
const sub_match<_Bi_iter>& __rhs)
- { return __lhs <= __rhs.str(); }
+ { return !(__rhs < __lhs); }
/**
* @brief Tests the equivalence of a regular expression submatch and a
inline bool
operator==(const sub_match<_Bi_iter>& __lhs,
typename iterator_traits<_Bi_iter>::value_type const& __rhs)
- { return __lhs.str() == __rhs; }
+ {
+ return __lhs.compare(typename sub_match<_Bi_iter>::string_type(1, __rhs))
+ == 0;
+ }
/**
* @brief Tests the inequivalence of a regular expression submatch and a
inline bool
operator!=(const sub_match<_Bi_iter>& __lhs,
typename iterator_traits<_Bi_iter>::value_type const& __rhs)
- { return __lhs.str() != __rhs; }
+ { return !(__lhs == __rhs); }
/**
* @brief Tests the ordering of a regular expression submatch and a string.
inline bool
operator<(const sub_match<_Bi_iter>& __lhs,
typename iterator_traits<_Bi_iter>::value_type const& __rhs)
- { return __lhs.str() < __rhs; }
+ {
+ return __lhs.compare(typename sub_match<_Bi_iter>::string_type(1, __rhs))
+ < 0;
+ }
/**
* @brief Tests the ordering of a regular expression submatch and a string.
inline bool
operator>(const sub_match<_Bi_iter>& __lhs,
typename iterator_traits<_Bi_iter>::value_type const& __rhs)
- { return __lhs.str() > __rhs; }
+ { return __rhs < __lhs; }
/**
* @brief Tests the ordering of a regular expression submatch and a string.
inline bool
operator>=(const sub_match<_Bi_iter>& __lhs,
typename iterator_traits<_Bi_iter>::value_type const& __rhs)
- { return __lhs.str() >= __rhs; }
+ { return !(__lhs < __rhs); }
/**
* @brief Tests the ordering of a regular expression submatch and a string.
inline bool
operator<=(const sub_match<_Bi_iter>& __lhs,
typename iterator_traits<_Bi_iter>::value_type const& __rhs)
- { return __lhs.str() <= __rhs; }
+ { return !(__rhs < __lhs); }
/**
* @brief Inserts a matched string into an output stream.
public:
/**
- * @name 10.1 Construction, Copying, and Destruction
+ * @name 28.10.1 Construction, Copying, and Destruction
*/
//@{
{ }
/**
+ * @brief Move constructs a %match_results.
+ */
+ match_results(match_results&& __rhs) noexcept
+ : _Base_type(std::move(__rhs))
+ { }
+
+ /**
* @brief Assigns rhs to *this.
*/
match_results&
- operator=(const match_results __rhs)
+ operator=(const match_results& __rhs)
{
match_results(__rhs).swap(*this);
return *this;
}
/**
+ * @brief Move-assigns rhs to *this.
+ */
+ match_results&
+ operator=(match_results&& __rhs)
+ {
+ match_results(std::move(__rhs)).swap(*this);
+ return *this;
+ }
+
+ /**
* @brief Destroys a %match_results object.
*/
~match_results()
bool ready() const { return !_Base_type::empty(); }
/**
- * @name 10.2 Size
+ * @name 28.10.2 Size
*/
//@{