mirror of
https://github.com/boostorg/container.git
synced 2026-01-26 17:22:46 +01:00
Update changelog and test function for GitHub #81 ("Vector with custom allocator does not support value types with operator&")
This commit is contained in:
@@ -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
|
||||
////////////////////////////////////
|
||||
|
||||
Reference in New Issue
Block a user