abseil / abseil/abseil-cpp

Provide ABI-option for differences between C++17, C++20 & C++23

未關閉
#1,280 1 則留言 2 個 reaction 已指派 0 人 在 GitHub 檢視
主要語言
C++
星號
18.1k
分支
3.2k
平均合併
20 小時 36 分鐘
30 天內合併 PR
1

描述

From #1127:
1) Is there a plan to document the various places in which the Abseil ABI differs between C++17 and C++20?
2) is there a plan to add a flag in `options.h` so that downstream packagers can force using the C++17 ABI? For now the [absl::bind_front implementation](https://github.com/abseil/abseil-cpp/blob/master/absl/functional/bind_front.h#L178) doesn't seem to provide any such mechanism.

_Originally posted by @pitrou in https://github.com/abseil/abseil-cpp/issues/1127#issuecomment-1242728025_

Additional selection of comments from that discussion:

> @derekmauro: The return type of `absl::bind_front` and `std::bind_front` is deliberately unspecified. I would like to see an example of code that somehow managed to use the return type in its ABI where the correct answer isn't using `std::function`, `absl::FunctionRef`, or `absl::AnyInvocable` instead.

> @coryan: Assuming C++ >= 17: https://godbolt.org/z/jhhWc8W7b
>
> Of course there are other ways to write this code that does not depend on a stable ABI, but this is not perverse code either.

PS. Same goes for other potential ABI-relevant differences between compiling abseil with C++17 vs. C++20.

貢獻指南

開啟貢獻指南

評估

這個 Issue 還沒有評估資料。

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。