Skip to content

Commit

Permalink
Added inline to destruction lambdas.
Browse files Browse the repository at this point in the history
  • Loading branch information
eyalz800 committed Aug 20, 2022
1 parent ef49158 commit 1202687
Showing 1 changed file with 20 additions and 20 deletions.
40 changes: 20 additions & 20 deletions zpp_bits.h
Original file line number Diff line number Diff line change
Expand Up @@ -2768,10 +2768,10 @@ class in

container.clear();

constexpr auto destructor = [](auto pointer) constexpr
{
access::destruct(*pointer);
};
constexpr auto destructor = [](auto pointer)
ZPP_BITS_CONSTEXPR_INLINE_LAMBDA {
access::destruct(*pointer);
};

for (std::size_t index{}; index < size; ++index)
{
Expand Down Expand Up @@ -2855,10 +2855,10 @@ class in
std::aligned_storage_t<sizeof(value_type), alignof(value_type)>
storage;

constexpr auto destructor = [](auto pointer) constexpr
{
access::destruct(*pointer);
};
constexpr auto destructor =
[](auto pointer) ZPP_BITS_CONSTEXPR_INLINE_LAMBDA {
access::destruct(*pointer);
};

std::unique_ptr<value_type, decltype(destructor)> object(
access::placement_new<value_type>(
Expand Down Expand Up @@ -2905,10 +2905,10 @@ class in
alignof(element_type)>
storage;

constexpr auto destructor = [](auto pointer) constexpr
{
access::destruct(*pointer);
};
constexpr auto destructor =
[](auto pointer) ZPP_BITS_CONSTEXPR_INLINE_LAMBDA {
access::destruct(*pointer);
};

std::unique_ptr<element_type, decltype(destructor)> object(
access::placement_new<element_type>(
Expand Down Expand Up @@ -2958,10 +2958,10 @@ class in
std::aligned_storage_t<sizeof(Types), alignof(Types)>
storage;

constexpr auto destructor = [](auto pointer) constexpr
{
access::destruct(*pointer);
};
constexpr auto destructor =
[](auto pointer) ZPP_BITS_CONSTEXPR_INLINE_LAMBDA {
access::destruct(*pointer);
};

std::unique_ptr<Types, decltype(destructor)> object(
access::placement_new<Types>(
Expand Down Expand Up @@ -4955,10 +4955,10 @@ struct pb
using archive_type = std::remove_reference_t<decltype(archive)>;
static_assert(check_type<type>());

constexpr auto destructor = [](auto pointer) constexpr
{
access::destruct(*pointer);
};
constexpr auto destructor = [](auto pointer)
ZPP_BITS_CONSTEXPR_INLINE_LAMBDA {
access::destruct(*pointer);
};

if constexpr (std::is_enum_v<type>) {
varint<type> value;
Expand Down

0 comments on commit 1202687

Please sign in to comment.