summaryrefslogtreecommitdiff
path: root/kernel/lib/libcxx/include/__algorithm/fill.h
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/lib/libcxx/include/__algorithm/fill.h')
-rw-r--r--kernel/lib/libcxx/include/__algorithm/fill.h30
1 files changed, 30 insertions, 0 deletions
diff --git a/kernel/lib/libcxx/include/__algorithm/fill.h b/kernel/lib/libcxx/include/__algorithm/fill.h
new file mode 100644
index 0000000..be09b1c
--- /dev/null
+++ b/kernel/lib/libcxx/include/__algorithm/fill.h
@@ -0,0 +1,30 @@
+// -*- C++ -*-
+//===----------------------------------------------------------------------===//
+//
+// Part of the BastionOS freestanding C++ standard library.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBBASTION_ALGORITHM_FILL_H
+#define _LIBBASTION_ALGORITHM_FILL_H
+
+#include <__config>
+
+_LIBBASTION_BEGIN_NAMESPACE_STD
+
+template<class _ForwardIt, class _Tp>
+constexpr void fill(_ForwardIt __first, _ForwardIt __last, const _Tp& __val) {
+ for (; __first != __last; ++__first)
+ *__first = __val;
+}
+
+template<class _OutputIt, class _Size, class _Tp>
+constexpr _OutputIt fill_n(_OutputIt __first, _Size __count, const _Tp& __val) {
+ for (_Size __i = 0; __i < __count; ++__i, ++__first)
+ *__first = __val;
+ return __first;
+}
+
+_LIBBASTION_END_NAMESPACE_STD
+
+#endif // _LIBBASTION_ALGORITHM_FILL_H