File indexing completed on 2025-01-18 09:50:26
0001
0002
0003
0004
0005
0006
0007
0008
0009 #ifndef BOOST_PROTO_DETAIL_IS_NONCOPYABLE_HPP_EAN_19_07_2012
0010 #define BOOST_PROTO_DETAIL_IS_NONCOPYABLE_HPP_EAN_19_07_2012
0011
0012 #include <boost/noncopyable.hpp>
0013 #include <boost/mpl/or.hpp>
0014 #include <boost/mpl/bool.hpp>
0015 #include <boost/type_traits/is_base_of.hpp>
0016 #include <boost/type_traits/is_abstract.hpp>
0017 #include <boost/type_traits/is_function.hpp>
0018 #include <boost/proto/proto_fwd.hpp>
0019
0020 namespace boost { namespace proto { namespace detail
0021 {
0022
0023
0024
0025 template<typename T>
0026 yes_type check_is_iostream(
0027 typename T::failure *
0028 , typename T::Init *
0029 , typename T::fmtflags *
0030 , typename T::iostate *
0031 , typename T::openmode *
0032 , typename T::seekdir *
0033 );
0034
0035 template<typename T>
0036 no_type check_is_iostream(...);
0037
0038 template<typename T>
0039 struct is_iostream
0040 {
0041 static bool const value = sizeof(yes_type) == sizeof(check_is_iostream<T>(0,0,0,0,0,0));
0042 typedef mpl::bool_<value> type;
0043 };
0044
0045
0046
0047
0048 template<typename T>
0049 struct is_noncopyable
0050 : mpl::or_<
0051 is_function<T>
0052 , is_abstract<T>
0053 , is_iostream<T>
0054 , is_base_of<noncopyable, T>
0055 >
0056 {};
0057
0058 template<typename T, std::size_t N>
0059 struct is_noncopyable<T[N]>
0060 : mpl::true_
0061 {};
0062
0063 }}}
0064
0065 #endif