boostorg / boostorg/multi_array
Feature request: constructor and resize from values
- Ngôn ngữ chính
- C++
- Star
- 32
- Fork
- 39
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Mô tả
Hello, this is a copy of my email I sent to the boost-users mailing list, as it might improve visibility.
I'd love to be able to use multi_array with classes that do not have a default constructor. At the moment, this is impossible, as both the constructor and resize functions only take extents as arguments (and possibly some other options), but no value_type, as for example std::vector does. Thus, trying to store objects without a default constructor in a multi_array results in hard compiler errors, with no workaround that I know of.
This happens to me fairly often, as I use multi_array to organize sets of complex objects. If there is a technical reason why this is not possible, I would also be happy to learn it.
Hướng dẫn đóng góp
Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này
Hướng nghiên cứu
Start by locating the multi_array constructor and resize APIs described in the issue, then inspect how they currently initialize elements and how std::vector accepts a value. Determine the supported design for supplying a value_type when creating or resizing an array. Done means non-default-constructible classes can be stored without hard compiler errors and existing extent-based behavior remains supported.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Công nghệ
- cpp
- Lĩnh vực
- data
- Loại issue
- Tính năng
- Độ khó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- Mức độ hoạt động
- Đình trệ
- Độ rõ ràng
- Khá rõ ràng
- Mức phù hợp với người mới
- 35/100