-
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.
[SetTheoretic] Add SetTheoretic concept
It adds SetTheoretic concept for functions- union, intersection, difference, symmetric_difference. Closes #357
- Loading branch information
1 parent
bcd7946
commit 81b808a
Showing
7 changed files
with
136 additions
and
9 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
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,36 @@ | ||
/*! | ||
@file | ||
Defines `boost::hana::SetTheoretic`. | ||
@copyright Shreyans Doshi 2017 | ||
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_SET_THEORETIC_HPP | ||
#define BOOST_HANA_CONCEPT_SET_THEORETIC_HPP | ||
|
||
#include <boost/hana/fwd/concept/set_theoretic.hpp> | ||
|
||
#include <boost/hana/config.hpp> | ||
#include <boost/hana/core/default.hpp> | ||
#include <boost/hana/core/tag_of.hpp> | ||
#include <boost/hana/detail/integral_constant.hpp> | ||
#include <boost/hana/difference.hpp> | ||
#include <boost/hana/intersection.hpp> | ||
#include <boost/hana/symmetric_difference.hpp> | ||
#include <boost/hana/union.hpp> | ||
|
||
|
||
BOOST_HANA_NAMESPACE_BEGIN | ||
template <typename STh> | ||
struct SetTheoretic | ||
: hana::integral_constant<bool, | ||
!is_default<difference_impl<typename tag_of<STh>::type>>::value && | ||
!is_default<intersection_impl<typename tag_of<STh>::type>>::value && | ||
!is_default<union_impl<typename tag_of<STh>::type>>::value | ||
> | ||
{ }; | ||
BOOST_HANA_NAMESPACE_END | ||
|
||
#endif // !BOOST_HANA_CONCEPT_SET_THEORETIC_HPP |
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,35 @@ | ||
/*! | ||
@file | ||
Forward declares `boost::hana::SetTheoretic`. | ||
@copyright Shreyans Doshi 2017 | ||
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_FWD_CONCEPT_SET_THEORETIC_HPP | ||
#define BOOST_HANA_FWD_CONCEPT_SET_THEORETIC_HPP | ||
|
||
#include <boost/hana/config.hpp> | ||
|
||
|
||
BOOST_HANA_NAMESPACE_BEGIN | ||
//! @ingroup group-concepts | ||
//! @defgroup group-SetTheoretic SetTheoretic | ||
//! The `SetTheoretic` concept represents data structures supporting | ||
//! algebra of sets. | ||
//! | ||
//! Minimal complete definition | ||
//! --------------------------- | ||
//! `union_`, `intersection`, `difference` and `symmetric_difference` | ||
//! | ||
//! Concrete models | ||
//! --------------- | ||
//! `hana::set`, `hana::map` | ||
//! | ||
//! | ||
template <typename STh> | ||
struct SetTheoretic; | ||
BOOST_HANA_NAMESPACE_END | ||
|
||
#endif // !BOOST_HANA_FWD_CONCEPT_SET_THEORETIC_HPP |
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