[DEV] add v1.76.0

This commit is contained in:
2021-10-05 21:37:46 +02:00
parent a97e9ae7d4
commit d0115b733d
45133 changed files with 4744437 additions and 1026325 deletions

View File

@@ -23,6 +23,7 @@
namespace hana = boost::hana;
namespace support {
template <typename T, typename = std::enable_if_t<
!hana::Constant<T>::value
>>
@@ -44,6 +45,7 @@ template <typename T, typename = std::enable_if_t<
constexpr auto sqrt(T const&) {
return hana::integral_c<typename T::value_type, sqrt(T::value)>;
}
} // end namespace support
namespace then {
@@ -51,7 +53,7 @@ namespace mpl = boost::mpl;
template <typename N>
struct sqrt
: mpl::integral_c<typename N::value_type, ::sqrt(N::value)>
: mpl::integral_c<typename N::value_type, support::sqrt(N::value)>
{ };
template <typename X, typename Y>
@@ -96,6 +98,8 @@ struct _point {
template <typename X, typename Y>
constexpr _point<X, Y> point(X x, Y y) { return {x, y}; }
using support::sqrt; // avoid conflicts with ::sqrt
//! [distance-hana]
template <typename P1, typename P2>
constexpr auto distance(P1 p1, P2 p2) {

View File

@@ -139,3 +139,20 @@ BOOST_HANA_CONSTANT_CHECK(has_member(hana::type_c<Foo>));
BOOST_HANA_CONSTANT_CHECK(!has_member(hana::type_c<Bar>));
//! [nested_template]
}
namespace template_specialization {
//! [template_specialization]
template <typename T, typename U>
struct Foo;
template <typename T>
struct Bar;
auto is_binary_template = hana::is_valid([](auto trait) -> decltype(
trait(hana::type_c<void>, hana::type_c<void>)
) { });
BOOST_HANA_CONSTANT_CHECK(is_binary_template(hana::template_<Foo>));
BOOST_HANA_CONSTANT_CHECK(!is_binary_template(hana::template_<Bar>));
//! [template_specialization]
}