diff --git a/doc/container.qbk b/doc/container.qbk index 9e66954..70b4273 100644 --- a/doc/container.qbk +++ b/doc/container.qbk @@ -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"]]. diff --git a/test/vector_test.cpp b/test/vector_test.cpp index 1e74451..903d3ea 100644 --- a/test/vector_test.cpp +++ b/test/vector_test.cpp @@ -56,6 +56,29 @@ int test_expand_bwd() return 0; } +struct X; + +template +struct XRef +{ + explicit XRef(T* ptr) noexcept : ptr(ptr) {} + operator T*() const noexcept { return ptr; } + T* ptr; +}; + +struct X +{ + XRef operator&() const noexcept { return XRef(this); } + XRef operator&() noexcept { return XRef(this); } +}; + + +bool test_smart_ref_type() +{ + boost::container::vector 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 ////////////////////////////////////