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

@@ -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
////////////////////////////////////