Skip to content

Replace deprecated std::aligned_storage usage in Boost.Fiber channels #338

@knightzone111

Description

@knightzone111

Boost.Fiber currently uses std::aligned_storage in channel iterator storage:

  • include/boost/fiber/buffered_channel.hpp
  • include/boost/fiber/unbuffered_channel.hpp
  • performance/thread/buffered_channel.hpp

std::aligned_storage is deprecated in C++23. This can produce deprecation warnings
with newer compilers, and may become a build failure when projects compile with
-Werror.

The storage is only used as raw storage for placement-new. It can be replaced with
equivalent aligned byte storage:

alignas(alignof(T)) unsigned char storage[sizeof(T)]{};

This keeps the same behavior while avoiding the deprecated C++23 API.

I have a patch ready that replaces the affected std::aligned_storage usages with
alignas(...) unsigned char[...].

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions