-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patharithmetic_test.cpp
More file actions
29 lines (21 loc) · 979 Bytes
/
arithmetic_test.cpp
File metadata and controls
29 lines (21 loc) · 979 Bytes
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
#include "lax_v1/arithmetic.hpp"
#include "config.hpp"
#include <type_traits>
static_assert(std::is_same_v<lax::force_c<lax::adds_m<lax::value_c<short, 1>,
lax::value_c<long, 2>>>,
lax::value_c<long, 3>>);
static_assert(
std::is_same_v<lax::force_c<lax::mod_m<lax::auto_c<2>, lax::auto_c<2>>>,
lax::auto_c<0>>);
static_assert(std::is_same_v<
lax::force_c<lax::muls_m<lax::auto_c<1>, lax::value_c<short, 2>>>,
lax::auto_c<2>>);
static_assert(
std::is_same_v<
lax::force_c<lax::div_m<lax::value_c<short, 6>, lax::value_c<char, 2>>>,
lax::auto_c<3>>);
static_assert(std::is_same_v<
lax::force_c<lax::sub_m<lax::auto_c<3>, lax::value_c<char, 2>>>,
lax::auto_c<1>>);
static_assert(std::is_same_v<lax::force_c<lax::neg_m<lax::value_c<short, 3>>>,
lax::auto_c<-3>>);