Add test for a deleted default constructor

This commit is contained in:
Peter Dimov
2017-10-29 18:31:41 +02:00
committed by Andrzej Krzemienski
parent 2d2c3c3f6f
commit 9e0726cee1
2 changed files with 41 additions and 0 deletions

View File

@ -0,0 +1,40 @@
// 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>
template<class T1, class T2> struct pair
{
T1 first;
T2 second;
pair(): first(), second()
{
}
};
struct A
{
A() = delete;
};
int main()
{
boost::optional< pair<A, int> > opt, opt2;
opt = opt2;
}
#endif