From ebef3ed6f79e1422292a3050a765956baf014e02 Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Sun, 29 Oct 2017 20:07:35 +0200 Subject: [PATCH] Try to make the test closer to the failing case in Beast --- test/optional_test_deleted_default_ctor.cpp | 26 ++++++++++++--------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/test/optional_test_deleted_default_ctor.cpp b/test/optional_test_deleted_default_ctor.cpp index 523908f..e98b381 100644 --- a/test/optional_test_deleted_default_ctor.cpp +++ b/test/optional_test_deleted_default_ctor.cpp @@ -15,25 +15,29 @@ int main() #else #include +#include -template struct pair +class basic_multi_buffer; + +class const_buffers_type { - T1 first; - T2 second; + basic_multi_buffer const* b_; - pair(): first(), second() - { - } -}; + friend class basic_multi_buffer; -struct A -{ - A() = delete; + explicit + const_buffers_type(basic_multi_buffer const& b); + +public: + + const_buffers_type() = delete; + const_buffers_type(const_buffers_type const&) = default; + const_buffers_type& operator=(const_buffers_type const&) = default; }; int main() { - boost::optional< pair > opt, opt2; + boost::optional< std::pair > opt, opt2; opt = opt2; }