2013-08-08 09:54:33 +00:00
|
|
|
/*=============================================================================
|
|
|
|
Copyright (c) 2011-2013 Bolero MURAKAMI
|
|
|
|
https://github.com/bolero-MURAKAMI/Sprout
|
|
|
|
|
|
|
|
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)
|
|
|
|
=============================================================================*/
|
2011-11-13 08:54:38 +00:00
|
|
|
#ifndef SPROUT_WEED_TRAITS_EXPR_TERMINAL_OF_HPP
|
|
|
|
#define SPROUT_WEED_TRAITS_EXPR_TERMINAL_OF_HPP
|
|
|
|
|
|
|
|
#include <type_traits>
|
|
|
|
#include <sprout/config.hpp>
|
2013-03-25 03:43:47 +00:00
|
|
|
#include <sprout/type_traits/identity.hpp>
|
2013-03-24 08:07:20 +00:00
|
|
|
#include <sprout/type_traits/remove_shallow_cvref.hpp>
|
2012-05-31 13:28:58 +00:00
|
|
|
#include <sprout/weed/expr/expr_fwd.hpp>
|
2011-11-13 08:54:38 +00:00
|
|
|
#include <sprout/weed/expr/tag.hpp>
|
|
|
|
#include <sprout/weed/traits/type/is_c_str.hpp>
|
|
|
|
#include <sprout/weed/detail/c_str_as_string.hpp>
|
|
|
|
|
|
|
|
namespace sprout {
|
|
|
|
namespace weed {
|
|
|
|
namespace traits {
|
|
|
|
//
|
|
|
|
// terminal_of
|
|
|
|
//
|
|
|
|
template<typename Arg, typename = void>
|
|
|
|
struct terminal_of;
|
|
|
|
template<typename Arg>
|
|
|
|
struct terminal_of<
|
|
|
|
Arg,
|
|
|
|
typename std::enable_if<
|
|
|
|
!sprout::weed::traits::is_c_str<
|
2013-03-26 17:02:16 +00:00
|
|
|
typename std::remove_reference<Arg>::type
|
2011-11-13 08:54:38 +00:00
|
|
|
>::value
|
|
|
|
>::type
|
2013-03-25 03:43:47 +00:00
|
|
|
>
|
|
|
|
: public sprout::identity<
|
|
|
|
sprout::weed::expr<
|
|
|
|
sprout::weed::tag::terminal,
|
|
|
|
typename sprout::remove_shallow_cvref<Arg>::type
|
|
|
|
>
|
|
|
|
>
|
|
|
|
{};
|
2011-11-13 08:54:38 +00:00
|
|
|
template<typename Arg>
|
|
|
|
struct terminal_of<
|
|
|
|
Arg,
|
|
|
|
typename std::enable_if<
|
|
|
|
sprout::weed::traits::is_c_str<
|
2013-03-26 17:02:16 +00:00
|
|
|
typename std::remove_reference<Arg>::type
|
2011-11-13 08:54:38 +00:00
|
|
|
>::value
|
|
|
|
>::type
|
2013-03-25 03:43:47 +00:00
|
|
|
>
|
|
|
|
: public sprout::identity<
|
|
|
|
sprout::weed::expr<
|
|
|
|
sprout::weed::tag::terminal,
|
|
|
|
typename sprout::weed::detail::c_str_as_string<
|
2013-03-26 17:02:16 +00:00
|
|
|
typename std::remove_reference<Arg>::type
|
2013-03-25 03:43:47 +00:00
|
|
|
>::type
|
|
|
|
>
|
|
|
|
>
|
|
|
|
{};
|
2011-11-13 08:54:38 +00:00
|
|
|
} // namespace traits
|
|
|
|
} // namespace weed
|
|
|
|
} // namespace sprout
|
|
|
|
|
|
|
|
#endif // #ifndef SPROUT_WEED_TRAITS_EXPR_TERMINAL_OF_HPP
|