-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add an implementation of or_ using is_same.
- Loading branch information
Showing
2 changed files
with
41 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,39 @@ | ||
/*! | ||
* @file | ||
* Defines `boost::mpl11::detail::logical_or::strict_is_same`. | ||
* | ||
* | ||
* @copyright Louis Dionne 2014 | ||
* Distributed under the Boost Software License, Version 1.0. | ||
* (See accompanying file LICENSE.md or copy at | ||
* http://www.boost.org/LICENSE_1_0.txt) | ||
*/ | ||
|
||
#ifndef BOOST_MPL11_DETAIL_LOGICAL_OR_STRICT_IS_SAME_HPP | ||
#define BOOST_MPL11_DETAIL_LOGICAL_OR_STRICT_IS_SAME_HPP | ||
|
||
#include <boost/mpl11/bool.hpp> | ||
#include <boost/mpl11/detail/std_is_same.hpp> | ||
|
||
|
||
namespace boost { namespace mpl11 { namespace detail { namespace logical_or { | ||
template <bool ...> | ||
struct strict_is_same_impl; | ||
|
||
/*! | ||
* @ingroup details | ||
* | ||
* Strict (non short-circuiting) logical or implemented with `is_same`. | ||
* | ||
* All credit goes to Roland Bock for the technique. | ||
*/ | ||
template <typename ...xs> | ||
using strict_is_same = bool_< | ||
!std_is_same< | ||
strict_is_same_impl<(bool)xs::type::value...>, | ||
strict_is_same_impl<(xs::type::value, false)...> | ||
>::value | ||
>; | ||
}}}} // end namespace boost::mpl11::detail::logical_or | ||
|
||
#endif // !BOOST_MPL11_DETAIL_LOGICAL_OR_STRICT_IS_SAME_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