-
Notifications
You must be signed in to change notification settings - Fork 216
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merging 'develop' into 'master' for 1.7.0
- Loading branch information
Showing
10 changed files
with
136 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,4 @@ | ||
Release notes for Hana 1.6.1 | ||
Release notes for Hana 1.7.0 | ||
============================ | ||
|
||
- Official support for Xcode 6, 7 and 8, 9, 10 and LLVM Clang 3.5, 3.6, 3.7, | ||
and 3.8 has has been dropped. The library should still work with these | ||
compilers, however they are not being tested regularly anymore, so they are | ||
not officially supported. | ||
- The `hana::traits::result_of` trait has been removed. Since `std::result_of` | ||
has been removed from the Standard in C++20, users should move away from it. | ||
- Disable the definition of traits::is_pod in C++20 and later, due to its | ||
deprecation. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
// Copyright Jason Rice 2020 | ||
// Distributed under the Boost Software License, Version 1.0. | ||
// (See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt) | ||
|
||
#include <boost/hana/define_struct.hpp> | ||
#include <boost/hana/equal.hpp> | ||
#include <boost/hana/members.hpp> | ||
#include <boost/hana/not_equal.hpp> | ||
namespace hana = boost::hana; | ||
|
||
|
||
struct SomeStruct { | ||
BOOST_HANA_DEFINE_STRUCT(SomeStruct, (int, x)); | ||
|
||
constexpr bool operator==(SomeStruct const& other) { | ||
return hana::equal(hana::members(*this), hana::members(other)); | ||
} | ||
|
||
constexpr bool operator!=(SomeStruct const& other) { | ||
return hana::not_equal(hana::members(*this), hana::members(other)); | ||
} | ||
}; | ||
|
||
int main() { | ||
static_assert(SomeStruct{5} == SomeStruct{5}, ""); | ||
static_assert(hana::equal(SomeStruct{5}, SomeStruct{5}), ""); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
// Copyright Jason Rice 2020 | ||
// Distributed under the Boost Software License, Version 1.0. | ||
// (See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt) | ||
|
||
#include <boost/hana/equal.hpp> | ||
#include <boost/hana/not_equal.hpp> | ||
#include <boost/hana/tuple.hpp> | ||
#include <cassert> | ||
namespace hana = boost::hana; | ||
|
||
namespace { | ||
template <typename T> | ||
struct optional { | ||
T t; | ||
}; | ||
|
||
template <typename T> | ||
constexpr bool operator==(optional<T> const& o, T const& t) { | ||
return o.t == t; | ||
} | ||
template <typename T> | ||
constexpr bool operator==(T const& t, optional<T> const& o) { | ||
return o.t == t; | ||
} | ||
template <typename T> | ||
constexpr bool operator!=(optional<T> const& o, T const& t) { | ||
return o.t != t; | ||
} | ||
template <typename T> | ||
constexpr bool operator!=(T const& t, optional<T> const& o) { | ||
return o.t != t; | ||
} | ||
} | ||
|
||
int main() { | ||
boost::hana::tuple<int> x{}; | ||
optional<boost::hana::tuple<int>> attr{x}; | ||
assert(attr == x); // <-- Kablooey! | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters