mirror of
https://github.com/boostorg/hana.git
synced 2026-01-21 17:02:25 +00:00
The commit that actually fixes this issue is 7f7c7a19, which adds an
embedding from `char` to any integral type with the proper signedness.
Closes #234
32 lines
968 B
C++
32 lines
968 B
C++
// Copyright Louis Dionne 2013-2016
|
|
// 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/assert.hpp>
|
|
#include <boost/hana/contains.hpp>
|
|
#include <boost/hana/integral_constant.hpp>
|
|
#include <boost/hana/map.hpp>
|
|
#include <boost/hana/pair.hpp>
|
|
#include <boost/hana/set.hpp>
|
|
namespace hana = boost::hana;
|
|
|
|
|
|
int main() {
|
|
{
|
|
auto set = hana::make_set(hana::int_c<1>, hana::char_c<'x'>);
|
|
|
|
BOOST_HANA_CONSTANT_CHECK(hana::contains(set, hana::int_c<1>));
|
|
BOOST_HANA_CONSTANT_CHECK(hana::contains(set, hana::char_c<'x'>));
|
|
}
|
|
|
|
{
|
|
auto map = hana::make_map(
|
|
hana::make_pair(hana::int_c<1>, 1),
|
|
hana::make_pair(hana::char_c<'x'>, 'x')
|
|
);
|
|
|
|
BOOST_HANA_CONSTANT_CHECK(hana::contains(map, hana::int_c<1>));
|
|
BOOST_HANA_CONSTANT_CHECK(hana::contains(map, hana::char_c<'x'>));
|
|
}
|
|
}
|