-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest_bind.cpp
35 lines (30 loc) · 918 Bytes
/
test_bind.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
// test_bind.hpp
//
// Copyright (c) 2009
// Steven Watanabe
//
// Distributed under the Boost Software License, Version 1.0. (See
// accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt
#include "./bind.hpp"
#include "./fold.hpp"
#include "./list.hpp"
#include "./eval.hpp"
#include "./assert_same.hpp"
#include "./identity.hpp"
ASSERT_SAME(
eval(bind(type(list), type<double>())),
bind_(type_<list_>&, type_<double>&)
);
ASSERT_SAME(
eval(apply(bind(type(list), type<double>()))),
eval(list(type<double>()))
);
ASSERT_SAME(
eval(fold(bind(type(list), _1, _2, type<double>()), type<int>(), list(type<char>()))),
eval(list(type<int>(), type<char>(), type<double>()))
);
ASSERT_SAME(
eval(fold(bind(type(list), bind(type(identity), _1), _2, type<double>()), type<int>(), list(type<char>()))),
eval(list(type<int>(), type<char>(), type<double>()))
);