boostorg / core

Boost Core Utilities
133 stars 83 forks source link

boost-1.81 and to_string issue #142

Closed Pro-pra closed 1 year ago

Pro-pra commented 1 year ago

Hi all, i compile ceph with boost-1.81 and see this error:

/builddir/build/BUILD/ceph-17.2.5/src/rgw/rgw_asio_client.cc:58:39: error: 'const class boost::core::basic_string_view<char>' has no member named 'to_string'
   58 |       env.set("CONTENT_LENGTH", value.to_string());

some headers may be missing?

pdimov commented 1 year ago

@vinniefalco @klemens-morgenstern What's the right thing to do here? core::string_view doesn't have to_string, because std::string_view doesn't have it. (value above comes from Beast: https://github.com/ceph/ceph/blob/94699750e2153341ae55dd492525e2ed5d483974/src/rgw/rgw_asio_client.cc#L42).

pdimov commented 1 year ago

@Pro-pra you might want to open an issue in https://github.com/ceph/ceph as well. Since it looks like env.set takes std::string:

https://github.com/ceph/ceph/blob/94699750e2153341ae55dd492525e2ed5d483974/src/rgw/rgw_common.h#L443

the fix would be as simple as removing .to_string(), but if ceph supports Boost versions older than 1.81, this might need to be #ifdef-ed on BOOST_VERSION.

Pro-pra commented 1 year ago

thank you!

I see in ceph https://github.com/ceph/ceph/pull/18866/files may be need unroll this patch?

pdimov commented 1 year ago

A part of it, yes.