Fixed compilation with gcc in C++23 mode.

This commit is contained in:
Andrey Semashev 2023-02-04 23:20:04 +03:00
parent f05ac885d1
commit 0451cb206d

View File

@ -228,8 +228,6 @@ private:
};
//! Path comparison operation
class compare_op;
friend class compare_op;
class compare_op
{
private:
@ -240,22 +238,12 @@ private:
explicit compare_op(path const& self) BOOST_NOEXCEPT : m_self(self) {}
BOOST_FORCEINLINE result_type operator() (const value_type* source, const value_type* source_end, const codecvt_type* = NULL) const
{
return m_self.compare(path(source, source_end));
}
result_type operator() (const value_type* source, const value_type* source_end, const codecvt_type* = NULL) const;
template< typename OtherChar >
BOOST_FORCEINLINE result_type operator() (const OtherChar* source, const OtherChar* source_end, const codecvt_type* cvt = NULL) const
{
path src;
detail::path_traits::convert(source, source_end, src.m_pathname, cvt);
return m_self.compare(src);
}
result_type operator() (const OtherChar* source, const OtherChar* source_end, const codecvt_type* cvt = NULL) const;
};
struct sfinae_helper;
public:
class iterator;
friend class iterator;
@ -1293,6 +1281,21 @@ BOOST_FORCEINLINE bool lexicographical_compare(path::iterator first1, path::iter
return BOOST_FILESYSTEM_VERSIONED_SYM(detail::lex_compare)(first1, last1, first2, last2) < 0;
}
BOOST_FORCEINLINE path::compare_op::result_type path::compare_op::operator() (const value_type* source, const value_type* source_end, const codecvt_type*) const
{
path src;
src.m_pathname.assign(source, source_end);
return m_self.compare(src);
}
template< typename OtherChar >
BOOST_FORCEINLINE path::compare_op::result_type path::compare_op::operator() (const OtherChar* source, const OtherChar* source_end, const codecvt_type* cvt) const
{
path src;
detail::path_traits::convert(source, source_end, src.m_pathname, cvt);
return m_self.compare(src);
}
BOOST_FORCEINLINE bool operator==(path const& lhs, path const& rhs)
{
return lhs.compare(rhs) == 0;