Bernd Amend 6668ecd170 Avoid unexpected behavior if move/copy is incorrectly implemented
ChaiScript 6 always used a shared_ptr to wrap C++ objects created in
ChaiScript. Newer versions avoid this by only wrapping objects that cannot
be copied. This has the side effect that ChaiScript depends on correctly
implemented C++ copy and move constructors in unexpected locations.
I don't think the reduced overhead (by avoiding the shared_ptr) justifies
the new behavior in every case.
Therefore, I suggest we temporarily only perform this optimization if the class
is trivially destructible, until unexpected copies and moves in ChaiScript
are fixed (if this is even possible), or there is a sanitizer/compiler warning
that can detect these cases.
Before the change the following code will call the ctor once, move once,
and the dtor twice:
  auto obj = MoveableObject();
After this change it will only call the ctor once and the dtor once.
2021-08-19 21:55:18 +02:00
..
any.hpp change .clang-format and reformat code with clang-format 11 2021-05-24 10:44:15 +02:00
bad_boxed_cast.hpp change .clang-format and reformat code with clang-format 11 2021-05-24 10:44:15 +02:00
bind_first.hpp change .clang-format and reformat code with clang-format 11 2021-05-24 10:44:15 +02:00
bootstrap_stl.hpp Fix crash with out of bounds index (issue #572) 2021-07-08 18:55:36 +02:00
bootstrap.hpp change .clang-format and reformat code with clang-format 11 2021-05-24 10:44:15 +02:00
boxed_cast_helper.hpp change .clang-format and reformat code with clang-format 11 2021-05-24 10:44:15 +02:00
boxed_cast.hpp change .clang-format and reformat code with clang-format 11 2021-05-24 10:44:15 +02:00
boxed_number.hpp change .clang-format and reformat code with clang-format 11 2021-05-24 10:44:15 +02:00
boxed_value.hpp change .clang-format and reformat code with clang-format 11 2021-05-24 10:44:15 +02:00
callable_traits.hpp change .clang-format and reformat code with clang-format 11 2021-05-24 10:44:15 +02:00
dispatchkit.hpp change .clang-format and reformat code with clang-format 11 2021-05-24 10:44:15 +02:00
dynamic_object_detail.hpp change .clang-format and reformat code with clang-format 11 2021-05-24 10:44:15 +02:00
dynamic_object.hpp change .clang-format and reformat code with clang-format 11 2021-05-24 10:44:15 +02:00
exception_specification.hpp change .clang-format and reformat code with clang-format 11 2021-05-24 10:44:15 +02:00
function_call_detail.hpp change .clang-format and reformat code with clang-format 11 2021-05-24 10:44:15 +02:00
function_call.hpp change .clang-format and reformat code with clang-format 11 2021-05-24 10:44:15 +02:00
function_params.hpp change .clang-format and reformat code with clang-format 11 2021-05-24 10:44:15 +02:00
function_signature.hpp change .clang-format and reformat code with clang-format 11 2021-05-24 10:44:15 +02:00
handle_return.hpp change .clang-format and reformat code with clang-format 11 2021-05-24 10:44:15 +02:00
operators.hpp change .clang-format and reformat code with clang-format 11 2021-05-24 10:44:15 +02:00
proxy_constructors.hpp Avoid unexpected behavior if move/copy is incorrectly implemented 2021-08-19 21:55:18 +02:00
proxy_functions_detail.hpp change .clang-format and reformat code with clang-format 11 2021-05-24 10:44:15 +02:00
proxy_functions.hpp change .clang-format and reformat code with clang-format 11 2021-05-24 10:44:15 +02:00
register_function.hpp change .clang-format and reformat code with clang-format 11 2021-05-24 10:44:15 +02:00
short_alloc.hpp change .clang-format and reformat code with clang-format 11 2021-05-24 10:44:15 +02:00
type_conversions.hpp change .clang-format and reformat code with clang-format 11 2021-05-24 10:44:15 +02:00
type_info.hpp change .clang-format and reformat code with clang-format 11 2021-05-24 10:44:15 +02:00