Compare commits

...

6 Commits

Author SHA1 Message Date
jzmaddock 6efa868bfa Update concepts to check for accidental char_traits usage.
Fixes: https://github.com/boostorg/regex/issues/202.
2024-03-25 13:26:54 +00:00
jzmaddock b1301061e5 Merge pull request #206 from boostorg/remove_nothrow
Remove throw() specification.
2024-03-24 17:00:44 +00:00
jzmaddock 6b78d0af7f Merge pull request #191 from ecatmur/deprecated-copy
Default empty destructor.
2024-03-24 16:47:49 +00:00
jzmaddock ecd5c207cf Remove throw() specification. 2024-03-24 16:45:43 +00:00
jzmaddock 4ca037c559 Merge pull request #205 from boostorg/remove_03
Remove outdated C++03 code.
2024-03-24 16:29:52 +00:00
Ed Catmur 57ccc945bd Default empty destructor.
The compiler-generated copy constructor and copy assignment operator are deprecated since C++11 on classes with user-declared destructors.

This change allows clean compilation with the -Wdeprecated-copy-dtor/-Wdeprecated-copy-with-user-provided-dtor flag.
2023-02-22 19:59:38 +00:00
3 changed files with 25 additions and 10 deletions
+8 -7
View File
@@ -76,13 +76,10 @@ inline long hash_value(char_architype val)
//
} // namespace boost
namespace std{
template<> struct char_traits<boost::char_architype>
{
// The intent is that this template is not instantiated,
// but this typedef gives us a chance of compilation in
// case it is:
typedef boost::char_architype char_type;
};
//
// We should never use this, if we do it should be an error:
//
template<> struct char_traits<boost::char_architype>;
}
//
// Allocator architype:
@@ -412,6 +409,10 @@ struct BaseRegexConcept
Regex e5(in1, in2, m_flags);
ignore_unused_variable_warning(e5);
// equals:
e1 == e2;
e1 != e2;
// assign etc:
Regex e;
e = m_pointer;
+16 -2
View File
@@ -488,7 +488,7 @@ public:
}
//
// swap:
void swap(basic_regex& that)throw()
void swap(basic_regex& that)noexcept
{
m_pimpl.swap(that.m_pimpl);
}
@@ -533,7 +533,21 @@ public:
return status() - that.status();
if(flags() != that.flags())
return flags() - that.flags();
return str().compare(that.str());
const char_type* i = m_pimpl->begin();
const char_type* j = that.m_pimpl->begin();
while ((i != m_pimpl->end()) && (j != that.m_pimpl->end()))
{
if (*i != *j)
return *i < *j ? -1 : 1;
++i;
++j;
}
if (i != m_pimpl->end())
return *i > static_cast<char_type>(0) ? 1 : -1;
if (j != that.m_pimpl->end())
return *j > static_cast<char_type>(0) ? -1 : 1;
return 0;
}
bool operator==(const basic_regex& e)const
{
+1 -1
View File
@@ -52,7 +52,7 @@ public:
, m_position(0)
{
}
~regex_error() noexcept override {}
~regex_error() noexcept override = default;
regex_constants::error_type code()const
{ return m_error_code; }
std::ptrdiff_t position()const