Update changelog and test function for GitHub #81 ("Vector with custom allocator does not support value types with operator&")

This commit is contained in:
Ion Gaztañaga
2018-11-11 02:03:30 +01:00
parent e94c779b56
commit 9bba03450f
2 changed files with 27 additions and 0 deletions

View File

@@ -1254,6 +1254,7 @@ use [*Boost.Container]? There are several reasons for that:
* Fixed bugs:
* [@https://github.com/boostorg/container/issues/77 GitHub #77: ['"warning: 'sbrk' is deprecated"]].
* [@https://github.com/boostorg/container/issues/79 GitHub #79: ['"Mark small_vector move operations noexcept"]].
* [@https://github.com/boostorg/container/issues/81 GitHub #81: ['"Vector with custom allocator does not support value types with operator&"]].
* [@https://github.com/boostorg/container/issues/82 GitHub #82: ['"Function definition in header file"]].
* [@https://github.com/boostorg/container/issues/83 GitHub #83: ['"Iterator zero incrementing leads to assert on empty vector"]].
* [@https://github.com/boostorg/container/pull/84 GitHub #84: ['"Allow vector to be assigned to itself"]].

View File

@@ -56,6 +56,29 @@ int test_expand_bwd()
return 0;
}
struct X;
template<typename T>
struct XRef
{
explicit XRef(T* ptr) noexcept : ptr(ptr) {}
operator T*() const noexcept { return ptr; }
T* ptr;
};
struct X
{
XRef<X const> operator&() const noexcept { return XRef<X const>(this); }
XRef<X> operator&() noexcept { return XRef<X>(this); }
};
bool test_smart_ref_type()
{
boost::container::vector<X> x(5);
return x.empty();
}
class recursive_vector
{
public:
@@ -184,6 +207,9 @@ int main()
v.push_back(Test());
}
if (test_smart_ref_type())
return 1;
////////////////////////////////////
// Backwards expansion test
////////////////////////////////////