mirror of
https://github.com/bolero-MURAKAMI/Sprout.git
synced 2025-07-16 15:14:13 +00:00
add c++14 constexpr version: fill, fill_n
This commit is contained in:
parent
3f85600f53
commit
7b11799ace
11 changed files with 152 additions and 17 deletions
|
@ -9,6 +9,20 @@
|
|||
#define SPROUT_ALGORITHM_FILL_HPP
|
||||
|
||||
#include <sprout/config.hpp>
|
||||
|
||||
namespace sprout {
|
||||
//
|
||||
// 25.3.6 Fill
|
||||
//
|
||||
template<typename ForwrdIterator, typename T>
|
||||
inline SPROUT_CXX14_CONSTEXPR void
|
||||
fill(ForwrdIterator first, ForwrdIterator last, T const& value) {
|
||||
while (first != last) {
|
||||
*first++ = value;
|
||||
}
|
||||
}
|
||||
} // namespace sprout
|
||||
|
||||
#include <sprout/algorithm/fixed/fill.hpp>
|
||||
#include <sprout/algorithm/fit/fill.hpp>
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue