2
0
mirror of https://github.com/boostorg/hana.git synced 2026-02-15 13:12:12 +00:00

Instantiate Searchable and Iterable with String.

This commit is contained in:
Louis Dionne
2014-10-21 22:13:48 -04:00
parent 2e94c2cd84
commit 806b941603
11 changed files with 447 additions and 11 deletions

22
test/string/string.cpp Normal file
View File

@@ -0,0 +1,22 @@
/*
@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/string/comparable.hpp>
#include <boost/hana/string/string.hpp>
#include <boost/hana/detail/assert.hpp>
using namespace boost::hana;
int main() {
auto s1 = BOOST_HANA_STRING("abcd");
auto s2 = string<'a', 'b', 'c', 'd'>;
BOOST_HANA_CONSTEXPR_ASSERT(s1.get()[0] == s2.get()[0]);
BOOST_HANA_CONSTEXPR_ASSERT(s1.get()[1] == s2.get()[1]);
BOOST_HANA_CONSTEXPR_ASSERT(s1.get()[2] == s2.get()[2]);
BOOST_HANA_CONSTEXPR_ASSERT(s1.get()[3] == s2.get()[3]);
}