diff options
author | Adrian Kummerlaender | 2015-02-02 18:58:36 +0100 |
---|---|---|
committer | Adrian Kummerlaender | 2015-02-02 18:58:36 +0100 |
commit | d86aac04e5225e705af0dd7749fdc1c0454088a8 (patch) | |
tree | 9d17e88d71fc64d0f94bdb02f76555ad79e058df /test.cc | |
parent | 2e167e9772f36f5e2239800e2e76e10bbb940e60 (diff) | |
download | TypeAsValue-d86aac04e5225e705af0dd7749fdc1c0454088a8.tar TypeAsValue-d86aac04e5225e705af0dd7749fdc1c0454088a8.tar.gz TypeAsValue-d86aac04e5225e705af0dd7749fdc1c0454088a8.tar.bz2 TypeAsValue-d86aac04e5225e705af0dd7749fdc1c0454088a8.tar.lz TypeAsValue-d86aac04e5225e705af0dd7749fdc1c0454088a8.tar.xz TypeAsValue-d86aac04e5225e705af0dd7749fdc1c0454088a8.tar.zst TypeAsValue-d86aac04e5225e705af0dd7749fdc1c0454088a8.zip |
Implemented `Delete` in terms of `Remove`
* analogously to how `Contains` is implemented as a wrapper around `Any`
* added appropriate test case and lessened restrictions on `Contains`'s comparator
Diffstat (limited to 'test.cc')
-rw-r--r-- | test.cc | 25 |
1 files changed, 25 insertions, 0 deletions
@@ -17,6 +17,7 @@ #include "list/generator/iota.h" #include "list/generator/make_list.h" #include "list/generator/higher/list_tabulate.h" +#include "list/operation/delete.h" #include "function/apply.h" @@ -434,6 +435,30 @@ static_assert( "(remove even? (list 1 2 3)) != (list 1 3)" ); +// list delete + +static_assert( + std::is_same< + tav::List<tav::Int<1>, tav::Int<3>>::type, + tav::Delete< + tav::Int<2>, + tav::List<tav::Int<1>, tav::Int<2>, tav::Int<3>>::type + >::type + >::value, + "(delete 2 (list 1 2 3)) != (list 1 3)" +); + +static_assert( + std::is_same< + tav::List<tav::Int<1>, tav::Int<2>, tav::Int<3>>::type, + tav::Delete< + tav::Int<4>, + tav::List<tav::Int<1>, tav::Int<2>, tav::Int<3>>::type + >::type + >::value, + "(delete 4 (list 1 2 3)) != (list 1 2 3)" +); + // list partition static_assert( |