summaryrefslogtreecommitdiff
path: root/boost/hana/detail
diff options
context:
space:
mode:
authorDongHun Kwak <dh0128.kwak@samsung.com>2016-10-06 10:41:18 +0900
committerDongHun Kwak <dh0128.kwak@samsung.com>2016-10-06 10:43:11 +0900
commitf763a99a501650eff2c60288aa6f10ef916d769e (patch)
tree02af7e13f9a38c888ebf340fe764cbe7dae99da9 /boost/hana/detail
parent5cde13f21d36c7224b0e13d11c4b49379ae5210d (diff)
downloadboost-f763a99a501650eff2c60288aa6f10ef916d769e.tar.gz
boost-f763a99a501650eff2c60288aa6f10ef916d769e.tar.bz2
boost-f763a99a501650eff2c60288aa6f10ef916d769e.zip
Imported Upstream version 1.62.0upstream/1.62.0
Change-Id: I9d4c1ddb7b7d8f0069217ecc582700f9fda6dd4c Signed-off-by: DongHun Kwak <dh0128.kwak@samsung.com>
Diffstat (limited to 'boost/hana/detail')
-rw-r--r--boost/hana/detail/algorithm.hpp8
-rw-r--r--boost/hana/detail/concepts.hpp2
-rw-r--r--boost/hana/detail/index_if.hpp2
-rw-r--r--boost/hana/detail/std_common_type.hpp4
4 files changed, 11 insertions, 5 deletions
diff --git a/boost/hana/detail/algorithm.hpp b/boost/hana/detail/algorithm.hpp
index d398659e2c..cf4ead5751 100644
--- a/boost/hana/detail/algorithm.hpp
+++ b/boost/hana/detail/algorithm.hpp
@@ -19,8 +19,10 @@ Distributed under the Boost Software License, Version 1.0.
BOOST_HANA_NAMESPACE_BEGIN namespace detail {
+ // Do not call this swap, otherwise it can get picked up by ADL and conflict
+ // with std::swap (see https://github.com/boostorg/hana/issues/297).
template <typename T>
- constexpr void swap(T& x, T& y) {
+ constexpr void constexpr_swap(T& x, T& y) {
auto tmp = x;
x = y;
y = std::move(tmp);
@@ -31,7 +33,7 @@ BOOST_HANA_NAMESPACE_BEGIN namespace detail {
while (first != last) {
if (first == --last)
break;
- detail::swap(*first, *last);
+ detail::constexpr_swap(*first, *last);
++first;
}
}
@@ -49,7 +51,7 @@ BOOST_HANA_NAMESPACE_BEGIN namespace detail {
BidirIter j = last;
while (!pred(*i, *--j))
;
- detail::swap(*i, *j);
+ detail::constexpr_swap(*i, *j);
detail::reverse(ip1, last);
return true;
}
diff --git a/boost/hana/detail/concepts.hpp b/boost/hana/detail/concepts.hpp
index a3095f5377..4031f356df 100644
--- a/boost/hana/detail/concepts.hpp
+++ b/boost/hana/detail/concepts.hpp
@@ -18,6 +18,7 @@ Distributed under the Boost Software License, Version 1.0.
BOOST_HANA_NAMESPACE_BEGIN namespace detail {
+ //! @cond
//////////////////////////////////////////////////////////////////////////
// EqualityComparable
//////////////////////////////////////////////////////////////////////////
@@ -71,6 +72,7 @@ BOOST_HANA_NAMESPACE_BEGIN namespace detail {
LessThanComparable<typename detail::std_common_type<T, U>::type>::value
>
{ };
+ //! @endcond
} BOOST_HANA_NAMESPACE_END
#endif // !BOOST_HANA_DETAIL_CONCEPTS_HPP
diff --git a/boost/hana/detail/index_if.hpp b/boost/hana/detail/index_if.hpp
index 116f278c87..81f6ea5630 100644
--- a/boost/hana/detail/index_if.hpp
+++ b/boost/hana/detail/index_if.hpp
@@ -46,6 +46,7 @@ BOOST_HANA_NAMESPACE_BEGIN namespace detail {
template <typename Pred, typename Ts, typename = when<true>>
struct index_if;
+ //! @cond
template <typename Pred, typename T, typename ...Ts>
struct index_if<Pred, pack<T, Ts...>, when<static_cast<bool>(decltype(
std::declval<Pred>()(std::declval<T>())
@@ -64,6 +65,7 @@ BOOST_HANA_NAMESPACE_BEGIN namespace detail {
struct index_if<Pred, pack<>> {
static constexpr std::size_t value = 0;
};
+ //! @endcond
} BOOST_HANA_NAMESPACE_END
#endif // !BOOST_HANA_DETAIL_INDEX_IF_HPP
diff --git a/boost/hana/detail/std_common_type.hpp b/boost/hana/detail/std_common_type.hpp
index 209c8fcb04..2eb0d6847e 100644
--- a/boost/hana/detail/std_common_type.hpp
+++ b/boost/hana/detail/std_common_type.hpp
@@ -11,8 +11,8 @@ Distributed under the Boost Software License, Version 1.0.
#define BOOST_HANA_DETAIL_STD_COMMON_TYPE_HPP
#include <boost/hana/config.hpp>
+#include <boost/hana/detail/decay.hpp>
-#include <type_traits>
#include <utility>
@@ -27,7 +27,7 @@ BOOST_HANA_NAMESPACE_BEGIN namespace detail {
struct std_common_type<T, U, decltype((void)(
true ? std::declval<T>() : std::declval<U>()
))> {
- using type = typename std::decay<
+ using type = typename detail::decay<
decltype(true ? std::declval<T>() : std::declval<U>())
>::type;
};