Skip to content

Commit

Permalink
Removed aligned_storage_t
Browse files Browse the repository at this point in the history
  • Loading branch information
gracicot committed May 15, 2023
1 parent 5d9a281 commit 5e2e24f
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 7 deletions.
2 changes: 1 addition & 1 deletion include/kangaru/detail/service_storage.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ struct service_storage {

private:
void* _service;
aligned_storage_t<sizeof(function_pointer), alignof(function_pointer)> forward_function;
alignas(alignof(function_pointer)) unsigned char forward_function[sizeof(function_pointer)];
};

/*
Expand Down
3 changes: 0 additions & 3 deletions include/kangaru/detail/traits.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,6 @@ using conditional_t = typename std::conditional<b, T, F>::type;
template<std::size_t S, typename T>
using tuple_element_t = typename std::tuple_element<S, T>::type;

template<std::size_t size, std::size_t align>
using aligned_storage_t = alignas(align) unsigned char[size];

template<typename F>
using function_seq = tuple_seq<function_arguments_t<F>>;

Expand Down
3 changes: 1 addition & 2 deletions include/kangaru/generic.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,7 @@ struct generic_service : detail::generic_service_destruction<generic_service<Typ

private:
friend detail::generic_service_destruction<generic_service<Type>, Type>;

detail::aligned_storage_t<sizeof(Type), alignof(Type)> _instance;
alignas(alignof(Type)) unsigned char _instance[sizeof(Type)];
};

/*
Expand Down
2 changes: 1 addition & 1 deletion include/kangaru/optional.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,7 @@ struct optional_base :
return *static_cast<type const*>(static_cast<void const*>(&_data));
}

aligned_storage_t<sizeof(type), alignof(type)> _data;
alignas(alignof(type)) unsigned char _data[sizeof(type)];
};

} // namespace detail
Expand Down

0 comments on commit 5e2e24f

Please sign in to comment.