Files
boost_optional/test/optional_test_deleted_default_ctor.cpp
T

45 lines
771 B
C++
Raw Normal View History

2017-10-29 18:31:41 +02:00
// Copyright 2017 Peter Dimov
//
// Distributed under the Boost Software License, Version 1.0.
//
// http://www.boost.org/LICENSE_1_0.txt
#include <boost/config.hpp>
#if defined(BOOST_NO_CXX11_DELETED_FUNCTIONS)
int main()
{
}
#else
#include <boost/optional.hpp>
#include <utility>
2017-10-29 18:31:41 +02:00
class basic_multi_buffer;
class const_buffers_type
2017-10-29 18:31:41 +02:00
{
basic_multi_buffer const* b_;
2017-10-29 18:31:41 +02:00
friend class basic_multi_buffer;
2017-10-29 18:31:41 +02:00
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;
2017-10-29 18:31:41 +02:00
};
int main()
{
boost::optional< std::pair<const_buffers_type, int> > opt, opt2;
2017-10-29 18:31:41 +02:00
opt = opt2;
}
#endif