1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465 |
- #ifndef BOOST_HANA_DETAIL_HAS_DUPLICATES_HPP
- #define BOOST_HANA_DETAIL_HAS_DUPLICATES_HPP
- #include <boost/hana/config.hpp>
- #include <boost/hana/detail/fast_and.hpp>
- #include <boost/hana/equal.hpp>
- #include <cstddef>
- #include <utility>
- namespace boost { namespace hana { namespace detail {
- template <typename T, typename ...U>
- constexpr std::size_t pack_count() {
- std::size_t c = 0;
- std::size_t expand[] = {0,
- (decltype(hana::equal(std::declval<T>(), std::declval<U>()))::value
- ? ++c
- : c)...
- };
- (void)expand;
- return c;
- }
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- template <typename ...T>
- struct has_duplicates {
- static constexpr bool value =
- sizeof...(T) > 0 &&
- !detail::fast_and<(detail::pack_count<T, T...>() == 1)...>::value
- ;
- };
- } }}
- #endif
|