// Copyright David Abrahams 2004. Use, modification and distribution is // subject to 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 #include #include "static_assert_same.hpp" #include #include template struct proxy_ptr { typedef T element_type; struct proxy { operator Ref() const; }; proxy operator*() const; }; template struct proxy_ref_ptr : proxy_ptr { }; template struct proxy_value_ptr : proxy_ptr { typedef typename boost::add_const::type element_type; }; struct X { template X(T const&); template operator T&() const; }; int main() { STATIC_ASSERT_SAME(boost::pointee >::type, int); STATIC_ASSERT_SAME(boost::pointee >::type, X); STATIC_ASSERT_SAME(boost::pointee >::type, int const); STATIC_ASSERT_SAME(boost::pointee >::type, X const); STATIC_ASSERT_SAME(boost::pointee >::type, int const); STATIC_ASSERT_SAME(boost::pointee >::type, X const); STATIC_ASSERT_SAME(boost::pointee >::type, int const); STATIC_ASSERT_SAME(boost::pointee >::type, X const); STATIC_ASSERT_SAME(boost::pointee::type, int); STATIC_ASSERT_SAME(boost::pointee::type, int const); STATIC_ASSERT_SAME(boost::pointee::type, X); STATIC_ASSERT_SAME(boost::pointee::type, X const); #if defined(BOOST_NO_CXX11_SMART_PTR) STATIC_ASSERT_SAME(boost::pointee >::type, int); STATIC_ASSERT_SAME(boost::pointee >::type, X); STATIC_ASSERT_SAME(boost::pointee >::type, int const); STATIC_ASSERT_SAME(boost::pointee >::type, X const); #else STATIC_ASSERT_SAME(boost::pointee >::type, int); STATIC_ASSERT_SAME(boost::pointee >::type, X); STATIC_ASSERT_SAME(boost::pointee >::type, int const); STATIC_ASSERT_SAME(boost::pointee >::type, X const); #endif STATIC_ASSERT_SAME(boost::pointee::iterator >::type, int); STATIC_ASSERT_SAME(boost::pointee::iterator >::type, X); STATIC_ASSERT_SAME(boost::pointee::const_iterator >::type, int const); STATIC_ASSERT_SAME(boost::pointee::const_iterator >::type, X const); return 0; }