1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980 |
- #ifndef BOOST_IOSTREAMS_DETAIL_IS_DEREFERENCEABLE_HPP_INCLUDED
- #define BOOST_IOSTREAMS_DETAIL_IS_DEREFERENCEABLE_HPP_INCLUDED
- # include <boost/type_traits/remove_cv.hpp>
- # include <boost/mpl/aux_/lambda_support.hpp>
- # include <boost/mpl/bool.hpp>
- # include <boost/detail/workaround.hpp>
- namespace boost { namespace iostreams { namespace detail {
- namespace is_dereferenceable_
- {
-
-
- struct tag {};
-
-
-
-
- struct any { template <class T> any(T const&); };
-
- tag operator*(any const&);
- # if BOOST_WORKAROUND(__MWERKS__, BOOST_TESTED_AT(0x3202))
- # define BOOST_comma(a,b) (a)
- # else
-
- tag operator,(tag,int);
- # define BOOST_comma(a,b) (a,b)
- # endif
-
-
- char (& check_increment(tag) )[2];
-
- template <class T>
- char check_increment(T const&);
-
- template <class T>
- struct impl
- {
- static typename boost::remove_cv<T>::type& x;
- BOOST_STATIC_CONSTANT(
- bool
- , value = sizeof(is_dereferenceable_::check_increment(BOOST_comma(*x,0))) == 1
- );
- };
- }
- # undef BOOST_comma
- template<typename T>
- struct is_dereferenceable
- : public ::boost::integral_constant<bool, is_dereferenceable_::impl<T>::value >
- {
- BOOST_MPL_AUX_LAMBDA_SUPPORT(1,is_dereferenceable,(T))
- };
- } }
- }
- #endif
|