File tree 3 files changed +16
-0
lines changed
3 files changed +16
-0
lines changed Original file line number Diff line number Diff line change 827
827
{
828
828
}
829
829
830
+ box (box const ^) = delete ;
831
+
830
832
[[unsafe::drop_only (T)]]
831
833
~box () safe {
832
834
delete p_;
Original file line number Diff line number Diff line change @@ -109,6 +109,7 @@ add_test(NAME "safecxx-verify-headers" COMMAND "${CMAKE_COMMAND}" --build ${CMAK
109
109
safe_cxx_compile_fail_test(string_view1 "use of sv depends on expired loan" )
110
110
safe_cxx_compile_fail_test(box_incomplete "class incomplete is incomplete" )
111
111
safe_cxx_compile_fail_test(box1 "cannot convert prvalue int to std2::box<int>" )
112
+ safe_cxx_compile_fail_test(box2 "call to deleted borrow constructor" )
112
113
safe_cxx_compile_fail_test(arc1 "cannot convert prvalue int to std2::arc<int>" )
113
114
safe_cxx_compile_fail_test(rc1 "cannot convert prvalue int to std2::rc<int>" )
114
115
safe_cxx_compile_fail_test(unsafe_cell1 "cannot convert prvalue std2::box<int> to std2::unsafe_cell<std2::box<int>>" )
Original file line number Diff line number Diff line change
1
+ // Copyright 2024 Christian Mazakas
2
+ // Distributed under the Boost Software License, Version 1.0. (See accompanying
3
+ // file LICENSE.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
4
+
5
+ #feature on safety
6
+
7
+ #include < std2.h>
8
+
9
+ int main ()
10
+ {
11
+ std2::box<int > p (1234 );
12
+ auto p2 = cpy p;
13
+ }
You can’t perform that action at this time.
0 commit comments