diff options
Diffstat (limited to 'boost/hana/concept')
-rw-r--r-- | boost/hana/concept/applicative.hpp | 31 | ||||
-rw-r--r-- | boost/hana/concept/comonad.hpp | 33 | ||||
-rw-r--r-- | boost/hana/concept/comparable.hpp | 29 | ||||
-rw-r--r-- | boost/hana/concept/constant.hpp | 29 | ||||
-rw-r--r-- | boost/hana/concept/euclidean_ring.hpp | 31 | ||||
-rw-r--r-- | boost/hana/concept/foldable.hpp | 31 | ||||
-rw-r--r-- | boost/hana/concept/functor.hpp | 31 | ||||
-rw-r--r-- | boost/hana/concept/group.hpp | 31 | ||||
-rw-r--r-- | boost/hana/concept/hashable.hpp | 30 | ||||
-rw-r--r-- | boost/hana/concept/integral_constant.hpp | 40 | ||||
-rw-r--r-- | boost/hana/concept/iterable.hpp | 33 | ||||
-rw-r--r-- | boost/hana/concept/logical.hpp | 33 | ||||
-rw-r--r-- | boost/hana/concept/metafunction.hpp | 38 | ||||
-rw-r--r-- | boost/hana/concept/monad.hpp | 31 | ||||
-rw-r--r-- | boost/hana/concept/monad_plus.hpp | 31 | ||||
-rw-r--r-- | boost/hana/concept/monoid.hpp | 31 | ||||
-rw-r--r-- | boost/hana/concept/orderable.hpp | 29 | ||||
-rw-r--r-- | boost/hana/concept/product.hpp | 31 | ||||
-rw-r--r-- | boost/hana/concept/ring.hpp | 31 | ||||
-rw-r--r-- | boost/hana/concept/searchable.hpp | 31 | ||||
-rw-r--r-- | boost/hana/concept/sequence.hpp | 41 | ||||
-rw-r--r-- | boost/hana/concept/struct.hpp | 29 |
22 files changed, 705 insertions, 0 deletions
diff --git a/boost/hana/concept/applicative.hpp b/boost/hana/concept/applicative.hpp new file mode 100644 index 0000000000..28c3af4242 --- /dev/null +++ b/boost/hana/concept/applicative.hpp @@ -0,0 +1,31 @@ +/*! +@file +Defines `boost::hana::Applicative`. + +@copyright Louis Dionne 2013-2016 +Distributed under the Boost Software License, Version 1.0. +(See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt) + */ + +#ifndef BOOST_HANA_CONCEPT_APPLICATIVE_HPP +#define BOOST_HANA_CONCEPT_APPLICATIVE_HPP + +#include <boost/hana/fwd/concept/applicative.hpp> + +#include <boost/hana/ap.hpp> +#include <boost/hana/config.hpp> +#include <boost/hana/core/default.hpp> +#include <boost/hana/core/tag_of.hpp> +#include <boost/hana/lift.hpp> + + +BOOST_HANA_NAMESPACE_BEGIN + template <typename A> + struct Applicative { + using Tag = typename tag_of<A>::type; + static constexpr bool value = !is_default<ap_impl<Tag>>::value && + !is_default<lift_impl<Tag>>::value; + }; +BOOST_HANA_NAMESPACE_END + +#endif // !BOOST_HANA_CONCEPT_APPLICATIVE_HPP diff --git a/boost/hana/concept/comonad.hpp b/boost/hana/concept/comonad.hpp new file mode 100644 index 0000000000..4aff1ab648 --- /dev/null +++ b/boost/hana/concept/comonad.hpp @@ -0,0 +1,33 @@ +/*! +@file +Defines `boost::hana::Comonad`. + +@copyright Louis Dionne 2013-2016 +Distributed under the Boost Software License, Version 1.0. +(See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt) + */ + +#ifndef BOOST_HANA_CONCEPT_COMONAD_HPP +#define BOOST_HANA_CONCEPT_COMONAD_HPP + +#include <boost/hana/fwd/concept/comonad.hpp> + +#include <boost/hana/config.hpp> +#include <boost/hana/core/default.hpp> +#include <boost/hana/core/tag_of.hpp> +#include <boost/hana/duplicate.hpp> +#include <boost/hana/extend.hpp> +#include <boost/hana/extract.hpp> + + +BOOST_HANA_NAMESPACE_BEGIN + template <typename W> + struct Comonad { + using Tag = typename tag_of<W>::type; + static constexpr bool value = !is_default<extract_impl<Tag>>::value && + (!is_default<duplicate_impl<Tag>>::value || + !is_default<extend_impl<Tag>>::value); + }; +BOOST_HANA_NAMESPACE_END + +#endif // !BOOST_HANA_CONCEPT_COMONAD_HPP diff --git a/boost/hana/concept/comparable.hpp b/boost/hana/concept/comparable.hpp new file mode 100644 index 0000000000..a38e5c6747 --- /dev/null +++ b/boost/hana/concept/comparable.hpp @@ -0,0 +1,29 @@ +/*! +@file +Defines `boost::hana::Comparable`. + +@copyright Louis Dionne 2013-2016 +Distributed under the Boost Software License, Version 1.0. +(See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt) + */ + +#ifndef BOOST_HANA_CONCEPT_COMPARABLE_HPP +#define BOOST_HANA_CONCEPT_COMPARABLE_HPP + +#include <boost/hana/fwd/concept/comparable.hpp> + +#include <boost/hana/config.hpp> +#include <boost/hana/core/default.hpp> +#include <boost/hana/core/tag_of.hpp> +#include <boost/hana/equal.hpp> + + +BOOST_HANA_NAMESPACE_BEGIN + template <typename T> + struct Comparable { + using Tag = typename tag_of<T>::type; + static constexpr bool value = !is_default<equal_impl<Tag, Tag>>::value; + }; +BOOST_HANA_NAMESPACE_END + +#endif // !BOOST_HANA_CONCEPT_COMPARABLE_HPP diff --git a/boost/hana/concept/constant.hpp b/boost/hana/concept/constant.hpp new file mode 100644 index 0000000000..1c85a20739 --- /dev/null +++ b/boost/hana/concept/constant.hpp @@ -0,0 +1,29 @@ +/*! +@file +Defines `boost::hana::Constant`. + +@copyright Louis Dionne 2013-2016 +Distributed under the Boost Software License, Version 1.0. +(See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt) + */ + +#ifndef BOOST_HANA_CONCEPT_CONSTANT_HPP +#define BOOST_HANA_CONCEPT_CONSTANT_HPP + +#include <boost/hana/fwd/concept/constant.hpp> + +#include <boost/hana/config.hpp> +#include <boost/hana/core/default.hpp> +#include <boost/hana/core/tag_of.hpp> +#include <boost/hana/value.hpp> + + +BOOST_HANA_NAMESPACE_BEGIN + template <typename C> + struct Constant { + using Tag = typename tag_of<C>::type; + static constexpr bool value = !is_default<value_impl<Tag>>::value; + }; +BOOST_HANA_NAMESPACE_END + +#endif // !BOOST_HANA_CONCEPT_CONSTANT_HPP diff --git a/boost/hana/concept/euclidean_ring.hpp b/boost/hana/concept/euclidean_ring.hpp new file mode 100644 index 0000000000..19ee1abcd5 --- /dev/null +++ b/boost/hana/concept/euclidean_ring.hpp @@ -0,0 +1,31 @@ +/*! +@file +Defines `boost::hana::EuclideanRing`. + +@copyright Louis Dionne 2013-2016 +Distributed under the Boost Software License, Version 1.0. +(See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt) + */ + +#ifndef BOOST_HANA_CONCEPT_EUCLIDEAN_RING_HPP +#define BOOST_HANA_CONCEPT_EUCLIDEAN_RING_HPP + +#include <boost/hana/fwd/concept/euclidean_ring.hpp> + +#include <boost/hana/config.hpp> +#include <boost/hana/core/default.hpp> +#include <boost/hana/core/tag_of.hpp> +#include <boost/hana/div.hpp> +#include <boost/hana/mod.hpp> + + +BOOST_HANA_NAMESPACE_BEGIN + template <typename R> + struct EuclideanRing { + using Tag = typename tag_of<R>::type; + static constexpr bool value = !is_default<mod_impl<Tag, Tag>>::value && + !is_default<div_impl<Tag, Tag>>::value; + }; +BOOST_HANA_NAMESPACE_END + +#endif // !BOOST_HANA_CONCEPT_EUCLIDEAN_RING_HPP diff --git a/boost/hana/concept/foldable.hpp b/boost/hana/concept/foldable.hpp new file mode 100644 index 0000000000..7737a74ce0 --- /dev/null +++ b/boost/hana/concept/foldable.hpp @@ -0,0 +1,31 @@ +/*! +@file +Defines `boost::hana::Foldable`. + +@copyright Louis Dionne 2013-2016 +Distributed under the Boost Software License, Version 1.0. +(See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt) + */ + +#ifndef BOOST_HANA_CONCEPT_FOLDABLE_HPP +#define BOOST_HANA_CONCEPT_FOLDABLE_HPP + +#include <boost/hana/fwd/concept/foldable.hpp> + +#include <boost/hana/config.hpp> +#include <boost/hana/core/default.hpp> +#include <boost/hana/core/tag_of.hpp> +#include <boost/hana/fold_left.hpp> +#include <boost/hana/unpack.hpp> + + +BOOST_HANA_NAMESPACE_BEGIN + template <typename T> + struct Foldable { + using Tag = typename tag_of<T>::type; + static constexpr bool value = !is_default<fold_left_impl<Tag>>::value || + !is_default<unpack_impl<Tag>>::value; + }; +BOOST_HANA_NAMESPACE_END + +#endif // !BOOST_HANA_CONCEPT_FOLDABLE_HPP diff --git a/boost/hana/concept/functor.hpp b/boost/hana/concept/functor.hpp new file mode 100644 index 0000000000..308abae56f --- /dev/null +++ b/boost/hana/concept/functor.hpp @@ -0,0 +1,31 @@ +/*! +@file +Defines `boost::hana::Functor`. + +@copyright Louis Dionne 2013-2016 +Distributed under the Boost Software License, Version 1.0. +(See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt) + */ + +#ifndef BOOST_HANA_CONCEPT_FUNCTOR_HPP +#define BOOST_HANA_CONCEPT_FUNCTOR_HPP + +#include <boost/hana/fwd/concept/functor.hpp> + +#include <boost/hana/config.hpp> +#include <boost/hana/adjust_if.hpp> +#include <boost/hana/core/default.hpp> +#include <boost/hana/core/tag_of.hpp> +#include <boost/hana/transform.hpp> + + +BOOST_HANA_NAMESPACE_BEGIN + template <typename F> + struct Functor { + using Tag = typename tag_of<F>::type; + static constexpr bool value = !is_default<transform_impl<Tag>>::value || + !is_default<adjust_if_impl<Tag>>::value; + }; +BOOST_HANA_NAMESPACE_END + +#endif // !BOOST_HANA_CONCEPT_FUNCTOR_HPP diff --git a/boost/hana/concept/group.hpp b/boost/hana/concept/group.hpp new file mode 100644 index 0000000000..025537110a --- /dev/null +++ b/boost/hana/concept/group.hpp @@ -0,0 +1,31 @@ +/*! +@file +Defines `boost::hana::Group`. + +@copyright Louis Dionne 2013-2016 +Distributed under the Boost Software License, Version 1.0. +(See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt) + */ + +#ifndef BOOST_HANA_CONCEPT_GROUP_HPP +#define BOOST_HANA_CONCEPT_GROUP_HPP + +#include <boost/hana/fwd/concept/group.hpp> + +#include <boost/hana/config.hpp> +#include <boost/hana/core/default.hpp> +#include <boost/hana/core/tag_of.hpp> +#include <boost/hana/minus.hpp> +#include <boost/hana/negate.hpp> + + +BOOST_HANA_NAMESPACE_BEGIN + template <typename G> + struct Group { + using Tag = typename tag_of<G>::type; + static constexpr bool value = !is_default<negate_impl<Tag>>::value || + !is_default<minus_impl<Tag, Tag>>::value; + }; +BOOST_HANA_NAMESPACE_END + +#endif // !BOOST_HANA_CONCEPT_GROUP_HPP diff --git a/boost/hana/concept/hashable.hpp b/boost/hana/concept/hashable.hpp new file mode 100644 index 0000000000..9fc282fb71 --- /dev/null +++ b/boost/hana/concept/hashable.hpp @@ -0,0 +1,30 @@ +/*! +@file +Defines `boost::hana::Hashable`. + +@copyright Louis Dionne 2016 +@copyright Jason Rice 2016 +Distributed under the Boost Software License, Version 1.0. +(See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt) + */ + +#ifndef BOOST_HANA_CONCEPT_HASHABLE_HPP +#define BOOST_HANA_CONCEPT_HASHABLE_HPP + +#include <boost/hana/fwd/concept/hashable.hpp> + +#include <boost/hana/config.hpp> +#include <boost/hana/core/default.hpp> +#include <boost/hana/core/tag_of.hpp> +#include <boost/hana/hash.hpp> + + +BOOST_HANA_NAMESPACE_BEGIN + template <typename T> + struct Hashable { + using Tag = typename tag_of<T>::type; + static constexpr bool value = !is_default<hash_impl<Tag>>::value; + }; +BOOST_HANA_NAMESPACE_END + +#endif // !BOOST_HANA_CONCEPT_HASHABLE_HPP diff --git a/boost/hana/concept/integral_constant.hpp b/boost/hana/concept/integral_constant.hpp new file mode 100644 index 0000000000..6e36551001 --- /dev/null +++ b/boost/hana/concept/integral_constant.hpp @@ -0,0 +1,40 @@ +/*! +@file +Defines `boost::hana::IntegralConstant`. + +@copyright Louis Dionne 2013-2016 +Distributed under the Boost Software License, Version 1.0. +(See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt) + */ + +#ifndef BOOST_HANA_CONCEPT_INTEGRAL_CONSTANT_HPP +#define BOOST_HANA_CONCEPT_INTEGRAL_CONSTANT_HPP + +#include <boost/hana/fwd/concept/integral_constant.hpp> + +#include <boost/hana/config.hpp> +#include <boost/hana/core/tag_of.hpp> + + +BOOST_HANA_NAMESPACE_BEGIN + namespace detail { + template <typename C, typename Tag = typename tag_of<C>::type> + struct integral_constant_dispatch { + static constexpr bool value = hana::IntegralConstant<Tag>::value; + }; + + template <typename C> + struct integral_constant_dispatch<C, C> { + static constexpr bool value = false; + }; + } + + //! @cond + template <typename C> + struct IntegralConstant + : detail::integral_constant_dispatch<C> + { }; + //! @endcond +BOOST_HANA_NAMESPACE_END + +#endif // !BOOST_HANA_CONCEPT_INTEGRAL_CONSTANT_HPP diff --git a/boost/hana/concept/iterable.hpp b/boost/hana/concept/iterable.hpp new file mode 100644 index 0000000000..78c1914077 --- /dev/null +++ b/boost/hana/concept/iterable.hpp @@ -0,0 +1,33 @@ +/*! +@file +Defines `boost::hana::Iterable`. + +@copyright Louis Dionne 2013-2016 +Distributed under the Boost Software License, Version 1.0. +(See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt) + */ + +#ifndef BOOST_HANA_CONCEPT_ITERABLE_HPP +#define BOOST_HANA_CONCEPT_ITERABLE_HPP + +#include <boost/hana/fwd/concept/iterable.hpp> + +#include <boost/hana/config.hpp> +#include <boost/hana/at.hpp> +#include <boost/hana/core/default.hpp> +#include <boost/hana/core/tag_of.hpp> +#include <boost/hana/drop_front.hpp> +#include <boost/hana/is_empty.hpp> + + +BOOST_HANA_NAMESPACE_BEGIN + template <typename It> + struct Iterable { + using Tag = typename tag_of<It>::type; + static constexpr bool value = !is_default<at_impl<Tag>>::value && + !is_default<drop_front_impl<Tag>>::value && + !is_default<is_empty_impl<Tag>>::value; + }; +BOOST_HANA_NAMESPACE_END + +#endif // !BOOST_HANA_CONCEPT_ITERABLE_HPP diff --git a/boost/hana/concept/logical.hpp b/boost/hana/concept/logical.hpp new file mode 100644 index 0000000000..74c0fb3a51 --- /dev/null +++ b/boost/hana/concept/logical.hpp @@ -0,0 +1,33 @@ +/*! +@file +Defines `boost::hana::Logical`. + +@copyright Louis Dionne 2013-2016 +Distributed under the Boost Software License, Version 1.0. +(See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt) + */ + +#ifndef BOOST_HANA_CONCEPT_LOGICAL_HPP +#define BOOST_HANA_CONCEPT_LOGICAL_HPP + +#include <boost/hana/fwd/concept/logical.hpp> + +#include <boost/hana/config.hpp> +#include <boost/hana/core/default.hpp> +#include <boost/hana/core/tag_of.hpp> +#include <boost/hana/eval_if.hpp> +#include <boost/hana/not.hpp> +#include <boost/hana/while.hpp> + + +BOOST_HANA_NAMESPACE_BEGIN + template <typename L> + struct Logical { + using Tag = typename tag_of<L>::type; + static constexpr bool value = !is_default<eval_if_impl<Tag>>::value && + !is_default<not_impl<Tag>>::value && + !is_default<while_impl<Tag>>::value; + }; +BOOST_HANA_NAMESPACE_END + +#endif // !BOOST_HANA_CONCEPT_LOGICAL_HPP diff --git a/boost/hana/concept/metafunction.hpp b/boost/hana/concept/metafunction.hpp new file mode 100644 index 0000000000..ed6d53ad87 --- /dev/null +++ b/boost/hana/concept/metafunction.hpp @@ -0,0 +1,38 @@ +/*! +@file +Defines `boost::hana::Metafunction`. + +@copyright Louis Dionne 2013-2016 +Distributed under the Boost Software License, Version 1.0. +(See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt) + */ + +#ifndef BOOST_HANA_CONCEPT_METAFUNCTION_HPP +#define BOOST_HANA_CONCEPT_METAFUNCTION_HPP + +#include <boost/hana/fwd/concept/metafunction.hpp> + +#include <boost/hana/config.hpp> +#include <boost/hana/core/tag_of.hpp> + + +BOOST_HANA_NAMESPACE_BEGIN + namespace detail { + template <typename F, typename Tag = typename tag_of<F>::type> + struct metafunction_dispatch { + static constexpr bool value = Metafunction<Tag>::value; + }; + + template <typename F> + struct metafunction_dispatch<F, F> { + static constexpr bool value = false; + }; + } + + template <typename F> + struct Metafunction + : detail::metafunction_dispatch<F> + { }; +BOOST_HANA_NAMESPACE_END + +#endif // !BOOST_HANA_CONCEPT_METAFUNCTION_HPP diff --git a/boost/hana/concept/monad.hpp b/boost/hana/concept/monad.hpp new file mode 100644 index 0000000000..ba1c33021f --- /dev/null +++ b/boost/hana/concept/monad.hpp @@ -0,0 +1,31 @@ +/*! +@file +Defines `boost::hana::Monad`. + +@copyright Louis Dionne 2013-2016 +Distributed under the Boost Software License, Version 1.0. +(See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt) + */ + +#ifndef BOOST_HANA_CONCEPT_MONAD_HPP +#define BOOST_HANA_CONCEPT_MONAD_HPP + +#include <boost/hana/fwd/concept/monad.hpp> + +#include <boost/hana/chain.hpp> +#include <boost/hana/config.hpp> +#include <boost/hana/core/default.hpp> +#include <boost/hana/core/tag_of.hpp> +#include <boost/hana/flatten.hpp> + + +BOOST_HANA_NAMESPACE_BEGIN + template <typename M> + struct Monad { + using Tag = typename tag_of<M>::type; + static constexpr bool value = !is_default<flatten_impl<Tag>>::value || + !is_default<chain_impl<Tag>>::value; + }; +BOOST_HANA_NAMESPACE_END + +#endif // !BOOST_HANA_CONCEPT_MONAD_HPP diff --git a/boost/hana/concept/monad_plus.hpp b/boost/hana/concept/monad_plus.hpp new file mode 100644 index 0000000000..22c67ca255 --- /dev/null +++ b/boost/hana/concept/monad_plus.hpp @@ -0,0 +1,31 @@ +/*! +@file +Defines `boost::hana::MonadPlus`. + +@copyright Louis Dionne 2013-2016 +Distributed under the Boost Software License, Version 1.0. +(See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt) + */ + +#ifndef BOOST_HANA_CONCEPT_MONAD_PLUS_HPP +#define BOOST_HANA_CONCEPT_MONAD_PLUS_HPP + +#include <boost/hana/fwd/concept/monad_plus.hpp> + +#include <boost/hana/concat.hpp> +#include <boost/hana/config.hpp> +#include <boost/hana/core/default.hpp> +#include <boost/hana/core/tag_of.hpp> +#include <boost/hana/empty.hpp> + + +BOOST_HANA_NAMESPACE_BEGIN + template <typename M> + struct MonadPlus { + using Tag = typename tag_of<M>::type; + static constexpr bool value = !is_default<concat_impl<Tag>>::value && + !is_default<empty_impl<Tag>>::value; + }; +BOOST_HANA_NAMESPACE_END + +#endif // !BOOST_HANA_CONCEPT_MONAD_PLUS_HPP diff --git a/boost/hana/concept/monoid.hpp b/boost/hana/concept/monoid.hpp new file mode 100644 index 0000000000..df84bb23e6 --- /dev/null +++ b/boost/hana/concept/monoid.hpp @@ -0,0 +1,31 @@ +/*! +@file +Defines `boost::hana::Monoid`. + +@copyright Louis Dionne 2013-2016 +Distributed under the Boost Software License, Version 1.0. +(See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt) + */ + +#ifndef BOOST_HANA_CONCEPT_MONOID_HPP +#define BOOST_HANA_CONCEPT_MONOID_HPP + +#include <boost/hana/fwd/concept/monoid.hpp> + +#include <boost/hana/config.hpp> +#include <boost/hana/core/default.hpp> +#include <boost/hana/core/tag_of.hpp> +#include <boost/hana/plus.hpp> +#include <boost/hana/zero.hpp> + + +BOOST_HANA_NAMESPACE_BEGIN + template <typename M> + struct Monoid { + using Tag = typename tag_of<M>::type; + static constexpr bool value = !is_default<zero_impl<Tag>>::value && + !is_default<plus_impl<Tag, Tag>>::value; + }; +BOOST_HANA_NAMESPACE_END + +#endif // !BOOST_HANA_CONCEPT_MONOID_HPP diff --git a/boost/hana/concept/orderable.hpp b/boost/hana/concept/orderable.hpp new file mode 100644 index 0000000000..5461332cd4 --- /dev/null +++ b/boost/hana/concept/orderable.hpp @@ -0,0 +1,29 @@ +/*! +@file +Defines `boost::hana::Orderable`. + +@copyright Louis Dionne 2013-2016 +Distributed under the Boost Software License, Version 1.0. +(See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt) + */ + +#ifndef BOOST_HANA_CONCEPT_ORDERABLE_HPP +#define BOOST_HANA_CONCEPT_ORDERABLE_HPP + +#include <boost/hana/fwd/concept/orderable.hpp> + +#include <boost/hana/config.hpp> +#include <boost/hana/core/default.hpp> +#include <boost/hana/core/tag_of.hpp> +#include <boost/hana/less.hpp> + + +BOOST_HANA_NAMESPACE_BEGIN + template <typename Ord> + struct Orderable { + using Tag = typename tag_of<Ord>::type; + static constexpr bool value = !is_default<less_impl<Tag, Tag>>::value; + }; +BOOST_HANA_NAMESPACE_END + +#endif // !BOOST_HANA_CONCEPT_ORDERABLE_HPP diff --git a/boost/hana/concept/product.hpp b/boost/hana/concept/product.hpp new file mode 100644 index 0000000000..1a77777b29 --- /dev/null +++ b/boost/hana/concept/product.hpp @@ -0,0 +1,31 @@ +/*! +@file +Defines `boost::hana::Product`. + +@copyright Louis Dionne 2013-2016 +Distributed under the Boost Software License, Version 1.0. +(See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt) + */ + +#ifndef BOOST_HANA_CONCEPT_PRODUCT_HPP +#define BOOST_HANA_CONCEPT_PRODUCT_HPP + +#include <boost/hana/fwd/concept/product.hpp> + +#include <boost/hana/config.hpp> +#include <boost/hana/core/default.hpp> +#include <boost/hana/core/tag_of.hpp> +#include <boost/hana/first.hpp> +#include <boost/hana/second.hpp> + + +BOOST_HANA_NAMESPACE_BEGIN + template <typename P> + struct Product { + using Tag = typename tag_of<P>::type; + static constexpr bool value = !is_default<first_impl<Tag>>::value && + !is_default<second_impl<Tag>>::value; + }; +BOOST_HANA_NAMESPACE_END + +#endif // !BOOST_HANA_CONCEPT_PRODUCT_HPP diff --git a/boost/hana/concept/ring.hpp b/boost/hana/concept/ring.hpp new file mode 100644 index 0000000000..3cc309e68a --- /dev/null +++ b/boost/hana/concept/ring.hpp @@ -0,0 +1,31 @@ +/*! +@file +Defines `boost::hana::Ring`. + +@copyright Louis Dionne 2013-2016 +Distributed under the Boost Software License, Version 1.0. +(See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt) + */ + +#ifndef BOOST_HANA_CONCEPT_RING_HPP +#define BOOST_HANA_CONCEPT_RING_HPP + +#include <boost/hana/fwd/concept/ring.hpp> + +#include <boost/hana/config.hpp> +#include <boost/hana/core/default.hpp> +#include <boost/hana/core/tag_of.hpp> +#include <boost/hana/mult.hpp> +#include <boost/hana/one.hpp> + + +BOOST_HANA_NAMESPACE_BEGIN + template <typename R> + struct Ring { + using Tag = typename tag_of<R>::type; + static constexpr bool value = !is_default<one_impl<Tag>>::value && + !is_default<mult_impl<Tag, Tag>>::value; + }; +BOOST_HANA_NAMESPACE_END + +#endif // !BOOST_HANA_CONCEPT_RING_HPP diff --git a/boost/hana/concept/searchable.hpp b/boost/hana/concept/searchable.hpp new file mode 100644 index 0000000000..923b57dfcf --- /dev/null +++ b/boost/hana/concept/searchable.hpp @@ -0,0 +1,31 @@ +/*! +@file +Defines `boost::hana::Searchable`. + +@copyright Louis Dionne 2013-2016 +Distributed under the Boost Software License, Version 1.0. +(See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt) + */ + +#ifndef BOOST_HANA_CONCEPT_SEARCHABLE_HPP +#define BOOST_HANA_CONCEPT_SEARCHABLE_HPP + +#include <boost/hana/fwd/concept/searchable.hpp> + +#include <boost/hana/any_of.hpp> +#include <boost/hana/config.hpp> +#include <boost/hana/core/default.hpp> +#include <boost/hana/core/tag_of.hpp> +#include <boost/hana/find_if.hpp> + + +BOOST_HANA_NAMESPACE_BEGIN + template <typename S> + struct Searchable { + using Tag = typename tag_of<S>::type; + static constexpr bool value = !is_default<any_of_impl<Tag>>::value && + !is_default<find_if_impl<Tag>>::value; + }; +BOOST_HANA_NAMESPACE_END + +#endif // !BOOST_HANA_CONCEPT_SEARCHABLE_HPP diff --git a/boost/hana/concept/sequence.hpp b/boost/hana/concept/sequence.hpp new file mode 100644 index 0000000000..b2c6cda50c --- /dev/null +++ b/boost/hana/concept/sequence.hpp @@ -0,0 +1,41 @@ +/*! +@file +Defines `boost::hana::Sequence`. + +@copyright Louis Dionne 2013-2016 +Distributed under the Boost Software License, Version 1.0. +(See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt) + */ + +#ifndef BOOST_HANA_CONCEPT_SEQUENCE_HPP +#define BOOST_HANA_CONCEPT_SEQUENCE_HPP + +#include <boost/hana/fwd/concept/sequence.hpp> + +#include <boost/hana/config.hpp> +#include <boost/hana/core/tag_of.hpp> +#include <boost/hana/core/when.hpp> + + +BOOST_HANA_NAMESPACE_BEGIN + namespace detail { + template <typename S, typename Tag = typename hana::tag_of<S>::type> + struct sequence_dispatch { + static constexpr bool value = hana::Sequence<Tag>::value; + }; + + template <typename S> + struct sequence_dispatch<S, S> { + static constexpr bool value = false; + }; + } + + //! @cond + template <typename S, bool condition> + struct Sequence<S, when<condition>> + : detail::sequence_dispatch<S> + { }; + //! @endcond +BOOST_HANA_NAMESPACE_END + +#endif // !BOOST_HANA_CONCEPT_SEQUENCE_HPP diff --git a/boost/hana/concept/struct.hpp b/boost/hana/concept/struct.hpp new file mode 100644 index 0000000000..709d0cccea --- /dev/null +++ b/boost/hana/concept/struct.hpp @@ -0,0 +1,29 @@ +/*! +@file +Defines `boost::hana::Struct`. + +@copyright Louis Dionne 2013-2016 +Distributed under the Boost Software License, Version 1.0. +(See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt) + */ + +#ifndef BOOST_HANA_CONCEPT_STRUCT_HPP +#define BOOST_HANA_CONCEPT_STRUCT_HPP + +#include <boost/hana/fwd/concept/struct.hpp> + +#include <boost/hana/accessors.hpp> +#include <boost/hana/config.hpp> +#include <boost/hana/core/default.hpp> +#include <boost/hana/core/tag_of.hpp> + + +BOOST_HANA_NAMESPACE_BEGIN + template <typename S> + struct Struct { + using Tag = typename tag_of<S>::type; + static constexpr bool value = !is_default<accessors_impl<Tag>>::value; + }; +BOOST_HANA_NAMESPACE_END + +#endif // !BOOST_HANA_CONCEPT_STRUCT_HPP |