is_disjoint.hpp 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. /*!
  2. @file
  3. Forward declares `boost::hana::is_disjoint`.
  4. @copyright Louis Dionne 2013-2017
  5. Distributed under the Boost Software License, Version 1.0.
  6. (See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt)
  7. */
  8. #ifndef BOOST_HANA_FWD_IS_DISJOINT_HPP
  9. #define BOOST_HANA_FWD_IS_DISJOINT_HPP
  10. #include <boost/hana/config.hpp>
  11. #include <boost/hana/core/when.hpp>
  12. BOOST_HANA_NAMESPACE_BEGIN
  13. //! Returns whether two `Searchable`s are disjoint.
  14. //! @ingroup group-Searchable
  15. //!
  16. //! Given two `Searchable`s `xs` and `ys`, `is_disjoint` returns a
  17. //! `Logical` representing whether the keys in `xs` are disjoint from
  18. //! the keys in `ys`, i.e. whether both structures have no keys in common.
  19. //!
  20. //!
  21. //! @param xs, ys
  22. //! Two `Searchable`s to test for disjointness.
  23. //!
  24. //!
  25. //! Example
  26. //! -------
  27. //! @include example/is_disjoint.cpp
  28. #ifdef BOOST_HANA_DOXYGEN_INVOKED
  29. constexpr auto is_disjoint = [](auto const& xs, auto const& ys) {
  30. return tag-dispatched;
  31. };
  32. #else
  33. template <typename S1, typename S2, typename = void>
  34. struct is_disjoint_impl : is_disjoint_impl<S1, S2, when<true>> { };
  35. struct is_disjoint_t {
  36. template <typename Xs, typename Ys>
  37. constexpr auto operator()(Xs&& xs, Ys&& ys) const;
  38. };
  39. constexpr is_disjoint_t is_disjoint{};
  40. #endif
  41. BOOST_HANA_NAMESPACE_END
  42. #endif // !BOOST_HANA_FWD_IS_DISJOINT_HPP