// (C) Copyright Gennadiy Rozental 2001. // Distributed under 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) // See http://www.boost.org/libs/test for the library home page. // // File : $RCSfile$ // // Version : $Revision$ // // Description : defines the is_cstring type trait // *************************************************************************** #ifndef BOOST_TEST_UTILS_IS_CSTRING_HPP #define BOOST_TEST_UTILS_IS_CSTRING_HPP // Boost #include #include #include #include #include #include #include //____________________________________________________________________________// namespace boost { namespace unit_test { // ************************************************************************** // // ************** is_cstring ************** // // ************************************************************************** // namespace ut_detail { template struct is_cstring_impl : public mpl::false_ {}; template struct is_cstring_impl : public is_cstring_impl {}; template struct is_cstring_impl : public is_cstring_impl {}; template<> struct is_cstring_impl : public mpl::true_ {}; template<> struct is_cstring_impl : public mpl::true_ {}; template struct deduce_cstring_impl { typedef typename boost::add_const< typename boost::remove_pointer< typename boost::decay::type >::type >::type type; }; template struct deduce_cstring_impl< std::basic_string > > { // const is required here typedef typename boost::add_const::type type; }; } // namespace ut_detail template struct is_cstring : public ut_detail::is_cstring_impl::type> {}; template struct is_cstring< std::basic_string > > : public mpl::true_ {}; template struct deduce_cstring { typedef typename boost::remove_const< typename boost::remove_reference::type >::type U; typedef typename ut_detail::deduce_cstring_impl::type type; }; } // namespace unit_test } // namespace boost #endif // BOOST_TEST_UTILS_IS_CSTRING_HPP