]>
git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/iterator/test/pointee.cpp
1 // Copyright David Abrahams 2004. Use, modification and distribution is
2 // subject to the Boost Software License, Version 1.0. (See accompanying
3 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
5 #include <boost/pointee.hpp>
6 #include <boost/type_traits/add_const.hpp>
7 #include "static_assert_same.hpp"
11 template <class T
, class Ref
>
14 typedef T element_type
;
19 proxy
operator*() const;
23 struct proxy_ref_ptr
: proxy_ptr
<T
,T
&>
28 struct proxy_value_ptr
: proxy_ptr
<T
,T
>
30 typedef typename
boost::add_const
<T
>::type element_type
;
34 template <class T
> X(T
const&);
35 template <class T
> operator T
&() const;
41 STATIC_ASSERT_SAME(boost::pointee
<proxy_ref_ptr
<int> >::type
, int);
42 STATIC_ASSERT_SAME(boost::pointee
<proxy_ref_ptr
<X
> >::type
, X
);
44 STATIC_ASSERT_SAME(boost::pointee
<proxy_ref_ptr
<int const> >::type
, int const);
45 STATIC_ASSERT_SAME(boost::pointee
<proxy_ref_ptr
<X
const> >::type
, X
const);
47 STATIC_ASSERT_SAME(boost::pointee
<proxy_value_ptr
<int> >::type
, int const);
48 STATIC_ASSERT_SAME(boost::pointee
<proxy_value_ptr
<X
> >::type
, X
const);
50 STATIC_ASSERT_SAME(boost::pointee
<proxy_value_ptr
<int const> >::type
, int const);
51 STATIC_ASSERT_SAME(boost::pointee
<proxy_value_ptr
<X
const> >::type
, X
const);
53 STATIC_ASSERT_SAME(boost::pointee
<int*>::type
, int);
54 STATIC_ASSERT_SAME(boost::pointee
<int const*>::type
, int const);
56 STATIC_ASSERT_SAME(boost::pointee
<X
*>::type
, X
);
57 STATIC_ASSERT_SAME(boost::pointee
<X
const*>::type
, X
const);
59 #if defined(BOOST_NO_CXX11_SMART_PTR)
61 STATIC_ASSERT_SAME(boost::pointee
<std::auto_ptr
<int> >::type
, int);
62 STATIC_ASSERT_SAME(boost::pointee
<std::auto_ptr
<X
> >::type
, X
);
64 STATIC_ASSERT_SAME(boost::pointee
<std::auto_ptr
<int const> >::type
, int const);
65 STATIC_ASSERT_SAME(boost::pointee
<std::auto_ptr
<X
const> >::type
, X
const);
69 STATIC_ASSERT_SAME(boost::pointee
<std::unique_ptr
<int> >::type
, int);
70 STATIC_ASSERT_SAME(boost::pointee
<std::unique_ptr
<X
> >::type
, X
);
72 STATIC_ASSERT_SAME(boost::pointee
<std::unique_ptr
<int const> >::type
, int const);
73 STATIC_ASSERT_SAME(boost::pointee
<std::unique_ptr
<X
const> >::type
, X
const);
77 STATIC_ASSERT_SAME(boost::pointee
<std::list
<int>::iterator
>::type
, int);
78 STATIC_ASSERT_SAME(boost::pointee
<std::list
<X
>::iterator
>::type
, X
);
80 STATIC_ASSERT_SAME(boost::pointee
<std::list
<int>::const_iterator
>::type
, int const);
81 STATIC_ASSERT_SAME(boost::pointee
<std::list
<X
>::const_iterator
>::type
, X
const);