/*============================================================================= Copyright (c) 2011-2016 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) =============================================================================*/ #ifndef SPROUT_WEED_ATTR_CNV_RESULTS_SHIFT_LEFT_HPP #define SPROUT_WEED_ATTR_CNV_RESULTS_SHIFT_LEFT_HPP #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include namespace sprout { namespace weed { namespace attr_cnv { namespace results { // // shift_left // template struct shift_left; // container >> container -> container template struct shift_left< T, U, typename std::enable_if< sprout::weed::detail::is_same_container::value >::type > : public sprout::fixed::results::append_back {}; // container >> V -> container template struct shift_left< T, U, typename std::enable_if< sprout::weed::detail::is_container_and_elem::value >::type > : public sprout::fixed::results::push_back {}; // V >> container -> container template struct shift_left< T, U, typename std::enable_if< sprout::weed::detail::is_elem_and_container::value >::type > : public sprout::fixed::results::push_front {}; // tuple >> tuple -> tuple template struct shift_left< T, U, typename std::enable_if< sprout::weed::detail::is_both_tuple::value >::type > : public sprout::tuples::results::append_back {}; // tuple >> V -> tuple template struct shift_left< T, U, typename std::enable_if< sprout::weed::detail::is_tuple_and_elem::value >::type > : public sprout::tuples::results::push_back {}; // V >> tuple -> tuple template struct shift_left< T, U, typename std::enable_if< sprout::weed::detail::is_elem_and_tuple::value >::type > : public sprout::tuples::results::push_front {}; // V >> V -> container template struct shift_left< T, U, typename std::enable_if< sprout::weed::detail::is_same_elem::value >::type > : public std::conditional< sprout::weed::traits::is_char_type::value, sprout::basic_string, sprout::array > {}; // V >> W -> tuple template struct shift_left< T, U, typename std::enable_if< sprout::weed::detail::is_different_elem::value >::type > : public sprout::identity > {}; // V >> unused -> V template struct shift_left< T, U, typename std::enable_if< sprout::weed::detail::is_elem_and_unused::value >::type > : public sprout::identity {}; // unused >> V -> V template struct shift_left< T, U, typename std::enable_if< sprout::weed::detail::is_unused_and_elem::value >::type > : public sprout::identity {}; // unused >> unused -> unused template struct shift_left< T, U, typename std::enable_if< sprout::weed::detail::is_both_unused::value >::type > : public sprout::identity {}; } // namespace results } // namespace attr_cnv } // namespace weed } // namespace sprout #endif // #ifndef SPROUT_WEED_ATTR_CNV_RESULTS_SHIFT_LEFT_HPP