#ifndef SPROUT_WEED_ATTR_CNV_BITWISE_OR_HPP #define SPROUT_WEED_ATTR_CNV_BITWISE_OR_HPP #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include namespace sprout { namespace weed { namespace attr_cnv { // // bitwise_or // // container | container -> container template SPROUT_CONSTEXPR inline typename std::enable_if< sprout::weed::detail::is_same_container::value, typename sprout::weed::attr_cnv::result_of::bitwise_or::type >::type bitwise_or(X const& x) { typedef typename sprout::weed::attr_cnv::result_of::bitwise_or::type type; return sprout::fixed::realign_to(x); } // container | V -> container template SPROUT_CONSTEXPR inline typename std::enable_if< sprout::weed::detail::is_container_and_elem::value && sprout::weed::traits::is_container::value, typename sprout::weed::attr_cnv::result_of::bitwise_or::type >::type bitwise_or(X const& x) { typedef typename sprout::weed::attr_cnv::result_of::bitwise_or::type type; return sprout::fixed::realign_to(x); } template SPROUT_CONSTEXPR inline typename std::enable_if< sprout::weed::detail::is_container_and_elem::value && !sprout::weed::traits::is_container::value, typename sprout::weed::attr_cnv::result_of::bitwise_or::type >::type bitwise_or(X const& x) { typedef typename sprout::weed::attr_cnv::result_of::bitwise_or::type type; return sprout::make_clone(x); } // V | container -> container template SPROUT_CONSTEXPR inline typename std::enable_if< sprout::weed::detail::is_elem_and_container::value && sprout::weed::traits::is_container::value, typename sprout::weed::attr_cnv::result_of::bitwise_or::type >::type bitwise_or(X const& x) { typedef typename sprout::weed::attr_cnv::result_of::bitwise_or::type type; return sprout::fixed::realign_to(x); } template SPROUT_CONSTEXPR inline typename std::enable_if< sprout::weed::detail::is_elem_and_container::value && !sprout::weed::traits::is_container::value, typename sprout::weed::attr_cnv::result_of::bitwise_or::type >::type bitwise_or(X const& x) { typedef typename sprout::weed::attr_cnv::result_of::bitwise_or::type type; return sprout::make_clone(x); } // tuple | tuple -> tuple template SPROUT_CONSTEXPR inline typename std::enable_if< sprout::weed::detail::is_both_tuple::value, typename sprout::weed::attr_cnv::result_of::bitwise_or::type >::type bitwise_or(X const& x) { typedef typename sprout::weed::attr_cnv::result_of::bitwise_or::type type; return sprout::tuples::copy(type(), x); } // V | V -> V template SPROUT_CONSTEXPR inline typename std::enable_if< sprout::weed::detail::is_same_elem::value, typename sprout::weed::attr_cnv::result_of::bitwise_or::type >::type bitwise_or(X const& x) { return x; } // V | unused -> container template SPROUT_CONSTEXPR inline typename std::enable_if< sprout::weed::detail::is_elem_and_unused::value && !sprout::weed::traits::is_unused::value, typename sprout::weed::attr_cnv::result_of::bitwise_or::type >::type bitwise_or(X const& x) { typedef typename sprout::weed::attr_cnv::result_of::bitwise_or::type type; return sprout::make_clone(x); } template SPROUT_CONSTEXPR inline typename std::enable_if< sprout::weed::detail::is_elem_and_unused::value && sprout::weed::traits::is_unused::value, typename sprout::weed::attr_cnv::result_of::bitwise_or::type >::type bitwise_or(X const& x) { typedef typename sprout::weed::attr_cnv::result_of::bitwise_or::type type; return sprout::make_clone(); } // unused | V -> container template SPROUT_CONSTEXPR inline typename std::enable_if< sprout::weed::detail::is_unused_and_elem::value && !sprout::weed::traits::is_unused::value, typename sprout::weed::attr_cnv::result_of::bitwise_or::type >::type bitwise_or(X const& x) { typedef typename sprout::weed::attr_cnv::result_of::bitwise_or::type type; return sprout::make_clone(x); } template SPROUT_CONSTEXPR inline typename std::enable_if< sprout::weed::detail::is_unused_and_elem::value && sprout::weed::traits::is_unused::value, typename sprout::weed::attr_cnv::result_of::bitwise_or::type >::type bitwise_or(X const& x) { typedef typename sprout::weed::attr_cnv::result_of::bitwise_or::type type; return sprout::make_clone(); } // unused >> unused -> unused template SPROUT_CONSTEXPR inline typename std::enable_if< sprout::weed::detail::is_both_unused::value, typename sprout::weed::attr_cnv::result_of::bitwise_or::type >::type bitwise_or(X const& x) { return sprout::weed::unused(); } } // namespace attr_cnv } // namespace weed } // namespace sprout #endif // #ifndef SPROUT_WEED_ATTR_CNV_BITWISE_OR_HPP