Chris@16: // (C) Copyright 2008 CodeRage, LLC (turkanis at coderage dot com) Chris@16: // (C) Copyright 2003-2007 Jonathan Turkanis Chris@16: // Distributed under the Boost Software License, Version 1.0. (See accompanying Chris@16: // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt.) Chris@16: Chris@16: // See http://www.boost.org/libs/iostreams for documentation. Chris@16: Chris@16: #ifndef BOOST_IOSTREAMS_DETAIL_BOOL_TRAIT_DEF_HPP_INCLUDED Chris@16: #define BOOST_IOSTREAMS_DETAIL_BOOL_TRAIT_DEF_HPP_INCLUDED Chris@16: Chris@16: #include // BOOST_STATIC_CONSTANT. Chris@16: #include Chris@16: #include Chris@16: #include Chris@16: #include Chris@16: #include Chris@16: #include Chris@16: Chris@16: // Chris@16: // Macro name: BOOST_IOSTREAMS_BOOL_TRAIT_DEF Chris@16: // Description: Used to generate the traits classes is_istream, is_ostream, Chris@16: // etc. Chris@16: // Chris@16: #if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x582)) Chris@16: # define BOOST_IOSTREAMS_TRAIT_NAMESPACE(trait) Chris@16: #else Chris@16: # define BOOST_IOSTREAMS_TRAIT_NAMESPACE(trait) BOOST_PP_CAT(trait, _impl_):: Chris@16: #endif Chris@16: #define BOOST_IOSTREAMS_BOOL_TRAIT_DEF(trait, type, arity) \ Chris@16: namespace BOOST_PP_CAT(trait, _impl_) { \ Chris@16: BOOST_IOSTREAMS_TEMPLATE_PARAMS(arity, T) \ Chris@16: type_traits::yes_type helper \ Chris@16: (const volatile type BOOST_IOSTREAMS_TEMPLATE_ARGS(arity, T)*); \ Chris@16: type_traits::no_type helper(...); \ Chris@16: template \ Chris@16: struct impl { \ Chris@16: BOOST_STATIC_CONSTANT(bool, value = \ Chris@16: (sizeof(BOOST_IOSTREAMS_TRAIT_NAMESPACE(trait) \ Chris@16: helper(static_cast(0))) == \ Chris@16: sizeof(type_traits::yes_type))); \ Chris@16: }; \ Chris@16: } \ Chris@16: template \ Chris@16: struct trait \ Chris@16: : mpl::bool_::value> \ Chris@16: { BOOST_MPL_AUX_LAMBDA_SUPPORT(1, trait, (T)) }; \ Chris@16: /**/ Chris@16: Chris@16: #endif // #ifndef BOOST_IOSTREAMS_DETAIL_BOOL_TRAIT_DEF_HPP_INCLUDED