Merged 44979, 45068, 45085, 45089, 45177, 45194, 45346, 45422, 45545, 46055 from trunk to release

[SVN r47345]
This commit is contained in:
Peter Dimov
2008-07-12 11:37:16 +00:00
parent 1bc4f16ff8
commit 07b4c17980
19 changed files with 1196 additions and 17 deletions
+68
View File
@@ -0,0 +1,68 @@
#include <boost/config.hpp>
// wp_convertible_test.cpp
//
// Copyright (c) 2008 Peter Dimov
//
// 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
#include <boost/detail/lightweight_test.hpp>
#include <boost/weak_ptr.hpp>
//
class incomplete;
struct X
{
};
struct Y
{
};
struct Z: public X
{
};
int f( boost::weak_ptr<void const> )
{
return 1;
}
int f( boost::weak_ptr<int> )
{
return 2;
}
int f( boost::weak_ptr<incomplete> )
{
return 3;
}
int g( boost::weak_ptr<X> )
{
return 4;
}
int g( boost::weak_ptr<Y> )
{
return 5;
}
int g( boost::weak_ptr<incomplete> )
{
return 6;
}
int main()
{
BOOST_TEST( 1 == f( boost::weak_ptr<double>() ) );
BOOST_TEST( 1 == f( boost::shared_ptr<double>() ) );
BOOST_TEST( 4 == g( boost::weak_ptr<Z>() ) );
BOOST_TEST( 4 == g( boost::shared_ptr<Z>() ) );
return boost::report_errors();
}