Broom 1.0.0
A thread-local C++ Garbage Collector
Loading...
Searching...
No Matches
broom-array.h
Go to the documentation of this file.
1#pragma once
2
3#include <array>
4
5#include "broom.h"
6#include "impl/broom-containers.h"
7
8#define ARRAY_METHODS(X_) \
9 CPP11_ARRAY_METHODS(X_) \
10 CPP14_ARRAY_METHODS(X_) \
11 CPP17_ARRAY_METHODS(X_) \
12 CPP20_ARRAY_METHODS(X_) \
13 CPP23_ARRAY_METHODS(X_)
14
15namespace broom {
26// XXX(gc): Implement via forwarding instead?
27template <typename T, size_t N>
28class array : private std::array<T, N>, public BroomValue {
29 using Base = std::array<T, N>;
30
31 public:
32 DEF_TYPES()
33 // FIXME(gc): Find a better way to do this.
35 template <typename... Args>
37 size_t i = 0;
38 for (const T p : {args...}) {
39 (*this)[i++] = p;
40 }
41 }
45};
46} // namespace broom
47
48#undef ARRAY_METHODS
49
50#include "impl/broom-undef.h"
#define ARRAY_METHODS(X_)
Definition broom-array.h:8
array(Args &&... args)
Definition broom-array.h:36
std::queue< T, broom::deque< T > > queue
Definition broom-queue.h:12