File indexing completed on 2025-01-18 09:38:50
0001
0002
0003
0004
0005
0006
0007
0008
0009 #ifndef BOOST_IOSTREAMS_DETAIL_IS_DEREFERENCEABLE_HPP_INCLUDED
0010 #define BOOST_IOSTREAMS_DETAIL_IS_DEREFERENCEABLE_HPP_INCLUDED
0011
0012 # include <boost/type_traits/remove_cv.hpp>
0013 # include <boost/mpl/aux_/lambda_support.hpp>
0014 # include <boost/mpl/bool.hpp>
0015 # include <boost/detail/workaround.hpp>
0016
0017 namespace boost { namespace iostreams { namespace detail {
0018
0019
0020
0021
0022
0023
0024
0025
0026 namespace is_dereferenceable_
0027 {
0028
0029
0030 struct tag {};
0031
0032
0033
0034
0035 struct any { template <class T> any(T const&); };
0036
0037
0038 tag operator*(any const&);
0039
0040 # if BOOST_WORKAROUND(__MWERKS__, BOOST_TESTED_AT(0x3202))
0041 # define BOOST_comma(a,b) (a)
0042 # else
0043
0044 tag operator,(tag,int);
0045 # define BOOST_comma(a,b) (a,b)
0046 # endif
0047
0048
0049 char (& check_increment(tag) )[2];
0050
0051 template <class T>
0052 char check_increment(T const&);
0053
0054 template <class T>
0055 struct impl
0056 {
0057 static typename boost::remove_cv<T>::type& x;
0058
0059 BOOST_STATIC_CONSTANT(
0060 bool
0061 , value = sizeof(is_dereferenceable_::check_increment(BOOST_comma(*x,0))) == 1
0062 );
0063 };
0064 }
0065
0066 # undef BOOST_comma
0067
0068 template<typename T>
0069 struct is_dereferenceable
0070 : public ::boost::integral_constant<bool, is_dereferenceable_::impl<T>::value >
0071 {
0072 BOOST_MPL_AUX_LAMBDA_SUPPORT(1,is_dereferenceable,(T))
0073 };
0074
0075 } }
0076
0077
0078 }
0079
0080 #endif