diff options
Diffstat (limited to 'src/list/operation/replace_nth.h')
-rw-r--r-- | src/list/operation/replace_nth.h | 23 |
1 files changed, 23 insertions, 0 deletions
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< + Take<Index, Sequence>, + List<Value>, + Drop<Add<Index, Size<1>>, Sequence> +>>; + +} + +#endif // TYPEASVALUE_SRC_LIST_OPERATION_REPLACE_NTH_H_ |