feat: make the public headers consumable as C++20 - #936
PingLiuPing wants to merge 11 commits into
Conversation
|
It seems there are some conflicts, please rebase the main branch. |
|
|
||
| project(example) | ||
|
|
||
| set(CMAKE_CXX_STANDARD 23) |
There was a problem hiding this comment.
Can we make C++23 still as default and let it accept user supplied option so that C++20 can be test manually locally.
There was a problem hiding this comment.
@zhjwpku Thank you for the comments.
Making it configurable is a good idea. Have different thoughts on making C++23 as default though.
With this patch, it changes the minimum supported C++ standard from C++23 to C++20 for downstream consumers. And C++20 is the interface contract between the consumer and iceberg-cpp library, and the contract should be tested continuously.
Setting the default to C++20 ensures the minimum supported standard (contract) is continuously exercised. Defaulting it to C++23 would let C++20 only breakages slip through.
One refinement is that C++23 compatibility should still be tested separately. C++23 should accepts C++20 code, but we can enhance this by provide an optional example configuration for C++23, for example, expose an ICEBERG_EXAMPLE_CXX_STANDARD cache setting that defaults to 20 and accepts 23; then update CI to build both.
And also refine the document to state clearly that the minimum C++ standard is C++20 for public headers. What do you think?
Happy to make changes either way.
There was a problem hiding this comment.
Make sense to me, I think we should build both for compatibility purpose.
Co-authored-by: Junwang Zhao <zhjwpku@gmail.com>
797da4f to
4a66df4
Compare
| @@ -0,0 +1,2401 @@ | |||
| /* | |||
There was a problem hiding this comment.
Do we have to put this file here? It will be better placed in a third_lib directory and a README to explain its purpose.
Enable C++20 consumers to include and use iceberg-cpp’s installed public headers while keeping iceberg-cpp implementation code and internal workflows on C++23.
Restore the vendored iceberg::expected backport — brings back src/iceberg/expected.h from #40 (removed by #139), with its test and LICENSE entry. unexpected's comparison operators now go through error().
Built and ran public_headers_cxx20 as an external C++20 package consumer; all 199 installed public headers compiled and linked.
Fix #928