variable_map implicit copy/move constructors
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- Mức phù hợp với người mới
- 30/100
Hướng nghiên cứu
Bắt đầu với include/boost/program_options/variables_map.hpp, quanh abstract_variables_map và variables_map, sau đó tái hiện trường hợp return-by-value từ main.cpp được báo cáo bằng Boost 1.88.0 và Clang 19.1.7. So sánh các tùy chọn của constructor và destructor với hướng dẫn C++ được liên kết, và định nghĩa done là một cách giải quyết copy/move-semantics đã được thống nhất, có coverage cho abstraction và cấu hình cảnh báo.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
We had abstracted our options and parsing (add_options(), store(), and command_line_parser()) calls to a function returning variables_map. This was working, but post updates to boost 1.88.0 (prior 1.75.0) + clang 19.1.7, this now produces an error. At this time the function was small (~15-20 lines) so moving into main was not as big of a deal but we have others where this abstraction could be beneficial from a readability perspective. Should the copy/move constructors be explicitly deleted due to the presence of the destructor, should explicit constructors be added to continue supporting this behavior, should the destructor be removed to allow default copy/move/destruct to be utilized? I am inclined to to vote for option 2 if this behavior should be persisted as the base class abstract_variables_map has a pointer member variable https://github.com/boostorg/program_options/blob/develop/include/boost/program_options/variables_map.hpp#L138 but do not have enough knowledge to know what risks might exist or what those should look like for this library.
In file included from /home/user/bitbucket/app/build/_deps/boost-src/libs/program_options/include/boost/program_options.hpp:18:
/home/user/bitbucket/app/build/_deps/boost-src/libs/program_options/include/boost/program_options/variables_map.hpp:111:17: error: definition of implicit copy constructor for 'abstract_variables_map' is deprecated because it has a user-provided destructor [-Werror,-Wdeprecated-copy-with-user-provided-dtor]
111 | virtual ~abstract_variables_map() {}
| ^
/home/user/bitbucket/app/build/_deps/boost-src/libs/program_options/include/boost/program_options/variables_map.hpp:146:38: note: in implicit copy constructor for 'boost::program_options::abstract_variables_map' first required here
146 | class BOOST_PROGRAM_OPTIONS_DECL variables_map : public abstract_variables_map,
| ^
/home/user/bitbucket/app/apps/app_name/src/main.cpp:59:12: note: in implicit move constructor for 'boost::program_options::variables_map' first required here
59 | return in_args;
| ^
https://quuxplusone.github.io/blog/2023/05/05/deprecated-copy-with-dtor/
https://stackoverflow.com/a/51864979
- Ngôn ngữ chính
- C++
- Star
- 136
- Fork
- 117
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
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
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của boostorg/program_options
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 45/100
boostorg/program_options#147 ·
-
non static member shadows Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 45/100
boostorg/program_options#144 ·
-
problem with different quotes Đang mở
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 45/100
boostorg/program_options#142 ·
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 30/100
boostorg/program_options#139 ·
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
boostorg/program_options#137 · 2 bình luận ·
Tất cả issue của boostorg/program_options
Issue tương tự
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 90/100
AXERA-TECH/ax-llm#77 ·
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 90/100
games-on-whales/wolf#509 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
-
bug-unconfirmed
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100