1 // (C) Copyright Gennadiy Rozental 2001.
2 // Distributed under the Boost Software License, Version 1.0.
3 // (See accompanying file LICENSE_1_0.txt or copy at
4 // http://www.boost.org/LICENSE_1_0.txt)
6 // See http://www.boost.org/libs/test for the library home page.
10 // Version : $Revision$
12 // Description : defines the is_cstring type trait
13 // ***************************************************************************
15 #ifndef BOOST_TEST_UTILS_IS_CSTRING_HPP
16 #define BOOST_TEST_UTILS_IS_CSTRING_HPP
19 #include <boost/mpl/bool.hpp>
20 #include <boost/type_traits/is_same.hpp>
21 #include <boost/type_traits/decay.hpp>
22 #include <boost/type_traits/remove_pointer.hpp>
24 //____________________________________________________________________________//
29 // ************************************************************************** //
30 // ************** is_cstring ************** //
31 // ************************************************************************** //
36 struct is_cstring_impl : public mpl::false_ {};
39 struct is_cstring_impl<T const*> : public is_cstring_impl<T*> {};
42 struct is_cstring_impl<T const* const> : public is_cstring_impl<T*> {};
45 struct is_cstring_impl<char*> : public mpl::true_ {};
48 struct is_cstring_impl<wchar_t*> : public mpl::true_ {};
50 } // namespace ut_detail
53 struct is_cstring : public ut_detail::is_cstring_impl<typename decay<T>::type> {};
55 } // namespace unit_test
58 #endif // BOOST_TEST_UTILS_IS_CSTRING_HPP