@@ -12,9 +12,9 @@ namespace {
1212template <std::size_t Size>
1313struct inline_resource : std::pmr::memory_resource {
1414 const char * name;
15- inline_resource (const char * name) : name(name) {}
16- std::byte buffer[Size];
17- std::byte* next{+this ->buffer };
15+ explicit inline_resource (const char * name) : name(name) {}
16+ std::byte buffer[Size]{}; // NOLINT(hicpp-avoid-c-arrays)
17+ std::byte* next{+this ->buffer }; // NOLINT(hicpp-no-array-decay)
1818
1919 void * do_allocate (std::size_t size, std::size_t ) override {
2020 std::cout << " allocating from=" << this ->name << " , size=" << size << " \n " ;
@@ -29,6 +29,7 @@ struct inline_resource : std::pmr::memory_resource {
2929 bool do_is_equal (const std::pmr::memory_resource& other) const noexcept override { return this == &other; }
3030};
3131
32+ // NOLINTBEGIN(hicpp-special-member-functions)
3233template <typename Fun>
3334struct allocator_aware_fun {
3435 using allocator_type = std::pmr::polymorphic_allocator<>;
@@ -38,10 +39,11 @@ struct allocator_aware_fun {
3839
3940 template <typename F>
4041 requires std::same_as<std::remove_cvref_t <F>, std::remove_cvref_t <Fun>>
41- allocator_aware_fun (F&& fun) : fun(std::forward<F>(fun)) {}
42+ explicit allocator_aware_fun (F&& fun) : fun(std::forward<F>(fun)) {}
4243 allocator_aware_fun (const allocator_aware_fun& other, allocator_type allocator = {})
4344 : fun(other.fun), allocator(allocator) {}
44- allocator_aware_fun (allocator_aware_fun&& other) : fun(std::move(other.fun)), allocator(other.allocator) {}
45+ allocator_aware_fun (allocator_aware_fun&& other) noexcept
46+ : fun(std::move(other.fun)), allocator(other.allocator) {}
4547 allocator_aware_fun (allocator_aware_fun&& other, allocator_type allocator)
4648 : fun(std::move(other.fun)), allocator(allocator) {}
4749
@@ -50,6 +52,7 @@ struct allocator_aware_fun {
5052 return this ->fun (this ->allocator , std::forward<Args>(args)...);
5153 }
5254};
55+ // NOLINTEND(hicpp-special-member-functions)
5356template <typename Fun>
5457allocator_aware_fun (Fun&& fun) -> allocator_aware_fun<Fun>;
5558
@@ -60,7 +63,7 @@ struct allocator_env {
6063} // namespace
6164
6265auto main () -> int {
63- int values[] = {1 , 2 , 3 };
66+ int values[] = {1 , 2 , 3 }; // NOLINT(hicpp-avoid-c-arrays)
6467 auto s{ex::just (std::span (values)) | ex::let_value (allocator_aware_fun ([](auto alloc, std::span<int > v) {
6568 return ex::just (std::pmr::vector<int >(v.begin (), v.end (), alloc));
6669 })) |
0 commit comments