2
0
mirror of https://github.com/boostorg/hana.git synced 2026-02-01 20:42:13 +00:00
Files
hana/example/core/common.cpp
Louis Dionne 4009555990 Refactor and improve IntegralConstant
- Add mandatory lossless conversions between instances
- implement `common` properly
2014-11-17 09:13:48 -05:00

29 lines
635 B
C++

/*
@copyright Louis Dionne 2014
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/core/common.hpp>
#include <boost/hana/integral.hpp>
#include <type_traits>
using namespace boost::hana;
int main() {
//! [main]
static_assert(std::is_same<
common_t<int, float>, std::common_type_t<int, float>
>{}, "");
static_assert(std::is_same<
common_t<int, Integral<int>>, int
>{}, "");
static_assert(std::is_same<
common_t<int, Integral<long>>, long
>{}, "");
//! [main]
}