Inline friend function definitions for exported/imported classes must become declarations and inline definitions outside the class for Embarcadero C++ clang-based compilers. This bug has been reported to Embarcadero.

This commit is contained in:
Edward Diener
2020-04-24 15:10:57 -04:00
parent 5d526092fb
commit cc5c59c7a5

View File

@@ -53,6 +53,8 @@ class BOOST_CONTAINER_DECL memory_resource
bool is_equal(const memory_resource& other) const BOOST_NOEXCEPT bool is_equal(const memory_resource& other) const BOOST_NOEXCEPT
{ return this->do_is_equal(other); } { return this->do_is_equal(other); }
#if !defined(BOOST_EMBTC)
//! <b>Returns</b>: //! <b>Returns</b>:
//! `&a == &b || a.is_equal(b)`. //! `&a == &b || a.is_equal(b)`.
friend bool operator==(const memory_resource& a, const memory_resource& b) BOOST_NOEXCEPT friend bool operator==(const memory_resource& a, const memory_resource& b) BOOST_NOEXCEPT
@@ -63,6 +65,18 @@ class BOOST_CONTAINER_DECL memory_resource
friend bool operator!=(const memory_resource& a, const memory_resource& b) BOOST_NOEXCEPT friend bool operator!=(const memory_resource& a, const memory_resource& b) BOOST_NOEXCEPT
{ return !(a == b); } { return !(a == b); }
#else
//! <b>Returns</b>:
//! `&a == &b || a.is_equal(b)`.
friend bool operator==(const memory_resource& a, const memory_resource& b) BOOST_NOEXCEPT;
//! <b>Returns</b>:
//! !(a == b).
friend bool operator!=(const memory_resource& a, const memory_resource& b) BOOST_NOEXCEPT;
#endif
protected: protected:
//! <b>Requires</b>: Alignment shall be a power of two. //! <b>Requires</b>: Alignment shall be a power of two.
//! //!
@@ -93,6 +107,20 @@ class BOOST_CONTAINER_DECL memory_resource
virtual bool do_is_equal(const memory_resource& other) const BOOST_NOEXCEPT = 0; virtual bool do_is_equal(const memory_resource& other) const BOOST_NOEXCEPT = 0;
}; };
#if defined(BOOST_EMBTC)
//! <b>Returns</b>:
//! `&a == &b || a.is_equal(b)`.
inline bool operator==(const memory_resource& a, const memory_resource& b) BOOST_NOEXCEPT
{ return &a == &b || a.is_equal(b); }
//! <b>Returns</b>:
//! !(a == b).
inline bool operator!=(const memory_resource& a, const memory_resource& b) BOOST_NOEXCEPT
{ return !(a == b); }
#endif
} //namespace pmr { } //namespace pmr {
} //namespace container { } //namespace container {
} //namespace boost { } //namespace boost {