Skip to content

Commit c2d7545

Browse files
add single argument constructor to vtr::array
1 parent 1e192c9 commit c2d7545

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

libs/libvtrutil/src/vtr_array.h

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,17 @@ class array {
5151
constexpr array(Args&&... args)
5252
: data_{ { std::forward<Args>(args)... } } {}
5353

54+
/**
55+
* @brief Fill the array with a single value
56+
*
57+
* This constructor initializes all elements to the given value.
58+
*
59+
* @param value The value to assign to all elements
60+
*/
61+
constexpr explicit array(const V& value) {
62+
data_.fill(value);
63+
}
64+
5465
array() = default;
5566

5667

0 commit comments

Comments
 (0)