From de1f1dc67a1dabcddac2e89a5d703e98a92b7f11 Mon Sep 17 00:00:00 2001 From: Adrian Kummerlaender Date: Fri, 20 Feb 2015 22:03:19 +0100 Subject: Added `ReplaceNth` list operation * as its name implies this function replaces the _nth_ element of a given list * added appropriate test case --- src/list/operation/replace_nth.h | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 src/list/operation/replace_nth.h (limited to 'src/list/operation/replace_nth.h') diff --git a/src/list/operation/replace_nth.h b/src/list/operation/replace_nth.h new file mode 100644 index 0000000..519a040 --- /dev/null +++ b/src/list/operation/replace_nth.h @@ -0,0 +1,23 @@ +#ifndef TYPEASVALUE_SRC_LIST_OPERATION_REPLACE_NTH_H_ +#define TYPEASVALUE_SRC_LIST_OPERATION_REPLACE_NTH_H_ + +#include "list/operation/concatenate.h" +#include "list/operation/take.h" +#include "list/operation/drop.h" + +namespace tav { + +template < + typename Index, + typename Value, + typename Sequence +> +using ReplaceNth = Concatenate, + List, + Drop>, Sequence> +>>; + +} + +#endif // TYPEASVALUE_SRC_LIST_OPERATION_REPLACE_NTH_H_ -- cgit v1.2.3