2002-04-10 16:04:53 +00:00
|
|
|
//
|
|
|
|
|
// shared_ptr_assign_fail.cpp - a negative test for shared_ptr assignment
|
|
|
|
|
//
|
|
|
|
|
// Copyright (c) 2002 Peter Dimov and Multi Media Ltd.
|
|
|
|
|
//
|
2004-07-26 00:32:12 +00:00
|
|
|
// Distributed under the Boost Software License, Version 1.0. (See
|
|
|
|
|
// accompanying file LICENSE_1_0.txt or copy at
|
|
|
|
|
// http://www.boost.org/LICENSE_1_0.txt)
|
2002-04-10 16:04:53 +00:00
|
|
|
//
|
|
|
|
|
|
|
|
|
|
#include <boost/shared_ptr.hpp>
|
|
|
|
|
|
|
|
|
|
int main()
|
|
|
|
|
{
|
|
|
|
|
boost::shared_ptr<int> p;
|
|
|
|
|
p = new int(42); // assignment must fail
|
|
|
|
|
return 0;
|
|
|
|
|
}
|