mirror of https://github.com/CGAL/cgal
use std integral_constant
This commit is contained in:
parent
d9bdf5cfc5
commit
6cd28f751e
|
|
@ -19,26 +19,13 @@
|
||||||
#define CGAL_TAGS_H
|
#define CGAL_TAGS_H
|
||||||
|
|
||||||
#include <CGAL/IO/io_tags.h>
|
#include <CGAL/IO/io_tags.h>
|
||||||
#include <boost/mpl/integral_c.hpp>
|
|
||||||
|
|
||||||
namespace CGAL {
|
namespace CGAL {
|
||||||
|
|
||||||
struct Void {};
|
struct Void {};
|
||||||
|
|
||||||
// Boolean_tag<bool> is a model of the Boost Integral Constant concept.
|
|
||||||
// https://www.boost.org/libs/mpl/doc/refmanual/integral-constant.html
|
|
||||||
template <bool b>
|
template <bool b>
|
||||||
struct Boolean_tag {
|
using Boolean_tag = std::bool_constant<b>;
|
||||||
typedef boost::mpl::integral_c_tag tag;
|
|
||||||
typedef bool value_type;
|
|
||||||
static const bool value = b;
|
|
||||||
typedef Boolean_tag<b> type;
|
|
||||||
operator bool() const { return this->value; }
|
|
||||||
};
|
|
||||||
/* In C++11, try:
|
|
||||||
template <bool b>
|
|
||||||
using Boolean_tag = std::integral_constant<bool, b>;
|
|
||||||
*/
|
|
||||||
|
|
||||||
typedef Boolean_tag<true> Tag_true;
|
typedef Boolean_tag<true> Tag_true;
|
||||||
typedef Boolean_tag<false> Tag_false;
|
typedef Boolean_tag<false> Tag_false;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue