Skip to content

boost/detail/atomic_count.hpp is deprecated #1121

Description

@IvanaGyro

Problem

"boost/detail/atomic_count.hpp" is deprecated since Boost 1.90.0. The new header is "boost/smart_ptr/detail/quick_allocator.hpp", which has been provided since 1.39.0.

CI use the latest version of Boost which is 1.91.0 now.

Warning Message from CI

    In file included from /opt/cytnx-deps/include/boost/config/header_deprecated.hpp:18,
                     from /opt/cytnx-deps/include/boost/detail/atomic_count.hpp:8,
                     from /project/include/intrusive_ptr_base.hpp:8,
                     from /project/include/Network.hpp:10,
                     from /project/src/Network.cpp:1:
    /opt/cytnx-deps/include/boost/detail/atomic_count.hpp:10:1: note: ‘#pragma message: This header is deprecated. Use <boost/smart_ptr/detail/atomic_count.hpp> instead.’
       10 | BOOST_HEADER_DEPRECATED("<boost/smart_ptr/detail/atomic_count.hpp>")
          | ^~~~~~~~~~~~~~~~~~~~~~~

Fix

Replace

#include <boost/detail/atomic_count.hpp>
and
mutable boost::detail::atomic_count ref_count;

with std::atomic<int>.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions