2
0
mirror of https://github.com/boostorg/hana.git synced 2026-02-02 08:52:11 +00:00

[Integral] Rename to IntegralConstant and improve the API

This commit is contained in:
Louis Dionne
2015-02-10 18:20:03 -05:00
parent 5dd70cbf3a
commit 17d2ce584c
82 changed files with 672 additions and 533 deletions

View File

@@ -5,15 +5,15 @@ Distributed under the Boost Software License, Version 1.0.
*/
#include <boost/hana/assert.hpp>
#include <boost/hana/integral.hpp>
#include <boost/hana/integral_constant.hpp>
#include <type_traits>
using namespace boost::hana;
//! [integral_create]
auto two = integral<int, 2>;
auto yes = integral<bool, true>;
auto two = integral_constant<int, 2>;
auto yes = integral_constant<bool, true>;
//! [integral_create]
//! [integral_api]
@@ -47,7 +47,7 @@ BOOST_HANA_CONSTANT_CHECK(-1234_c == llong<-1234>);
}
//! [integral_operators]
BOOST_HANA_CONSTANT_CHECK(int_<1> == integral<int, 1>);
BOOST_HANA_CONSTANT_CHECK(int_<1> == integral_constant<int, 1>);
BOOST_HANA_CONSTANT_CHECK(int_<1> + long_<2> == long_<3>);
BOOST_HANA_CONSTANT_CHECK(!(bool_<true> && bool_<false>));
//! [integral_operators]