-
Notifications
You must be signed in to change notification settings - Fork 39
feat boost.conversion: initial boost.conversion C++20 modules support #34
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
fdr400
wants to merge
29
commits into
boostorg:develop
Choose a base branch
from
fdr400:feature/fdr400/cxx20-modules
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
29 commits
Select commit
Hold shift + click to select a range
71acb7d
work
fdr400 abdf5c9
do not support compile fail tests
fdr400 46b19e3
add module test CI
fdr400 260c852
fix directory name
fdr400 68c9b47
add missing includes
fdr400 fa31313
fix preprocessor order
fdr400 6b6cd75
add mu test
fdr400 fbb6b00
remove not required includes
fdr400 1873b23
fix newlines
fdr400 8cdac8f
add copyright
fdr400 5f5dcf4
add import std tests
fdr400 2779882
set standard explicitly
fdr400 dac489a
add test-dir path
fdr400 4d5301f
use anchors
fdr400 57e25a8
better names
fdr400 e8383a0
do not run additional CI
fdr400 68d2c68
better names
fdr400 4aadf22
use matrix compiler
fdr400 028398e
ident
fdr400 e4c0416
better
fdr400 16c0bdc
ident
fdr400 02d5d23
remove unused variable
fdr400 d198230
return pull request CI
fdr400 037ab83
fix test build
fdr400 7a30fcc
disable tests again
fdr400 f029296
try add test again
fdr400 aef7a54
fix tests enabling
fdr400 c77da14
cosmetics
fdr400 7a8d083
disable assertion fail tests
fdr400 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| // Copyright (c) 2016-2026 Antony Polukhin | ||
| // | ||
| // Distributed under the Boost Software License, Version 1.0. (See accompanying | ||
| // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) | ||
|
|
||
| #ifndef BOOST_CONVERSION_DETAIL_CONFIG_HPP | ||
| #define BOOST_CONVERSION_DETAIL_CONFIG_HPP | ||
|
|
||
| #if !defined(BOOST_CONVERSION_INTERFACE_UNIT) | ||
| # include <boost/config.hpp> | ||
| # ifdef BOOST_HAS_PRAGMA_ONCE | ||
| # pragma once | ||
| # endif | ||
| #endif | ||
|
|
||
| #ifdef BOOST_CONVERSION_INTERFACE_UNIT | ||
| # define BOOST_CONVERSION_BEGIN_MODULE_EXPORT export { | ||
| # define BOOST_CONVERSION_END_MODULE_EXPORT } | ||
| #else | ||
| # define BOOST_CONVERSION_BEGIN_MODULE_EXPORT | ||
| # define BOOST_CONVERSION_END_MODULE_EXPORT | ||
| #endif | ||
|
|
||
| #if defined(BOOST_USE_MODULES) && !defined(BOOST_CONVERSION_INTERFACE_UNIT) | ||
| import boost.conversion; | ||
| #endif | ||
|
|
||
| #endif |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,33 @@ | ||
| // Copyright (c) 2016-2026 Antony Polukhin | ||
| // | ||
| // Distributed under the Boost Software License, Version 1.0. (See accompanying | ||
| // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) | ||
|
|
||
| module; | ||
|
|
||
| #include <boost/config.hpp> | ||
| #include <boost/throw_exception.hpp> | ||
| #include <boost/assert.hpp> | ||
| #include <boost/pointer_cast.hpp> | ||
|
|
||
| #ifndef BOOST_CONVERSION_USE_STD_MODULE | ||
| #include <memory> | ||
| #include <typeinfo> | ||
| #include <type_traits> | ||
| #endif | ||
|
|
||
| #define BOOST_CONVERSION_INTERFACE_UNIT | ||
|
|
||
| export module boost.conversion; | ||
|
|
||
| #ifdef BOOST_CONVERSION_USE_STD_MODULE | ||
| import std; | ||
| #endif | ||
|
|
||
| #ifdef __clang__ | ||
| # pragma clang diagnostic ignored "-Winclude-angled-in-module-purview" | ||
| #endif | ||
|
|
||
| #include <boost/implicit_cast.hpp> | ||
| #include <boost/polymorphic_cast.hpp> | ||
| #include <boost/polymorphic_pointer_cast.hpp> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,36 @@ | ||
| // Copyright (c) 2016-2026 Antony Polukhin | ||
| // | ||
| // Distributed under the Boost Software License, Version 1.0. (See accompanying | ||
| // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) | ||
|
|
||
| #include <iostream> | ||
| #include <memory> | ||
| #include <string> | ||
|
|
||
| import boost.conversion; | ||
|
|
||
| namespace { | ||
|
|
||
| struct Base { | ||
| virtual ~Base() = default; | ||
| virtual std::string name() const { | ||
| return "base"; | ||
| } | ||
| }; | ||
|
|
||
| struct Derived : Base { | ||
| std::string name() const override { | ||
| return "derived"; | ||
| } | ||
| }; | ||
|
|
||
| } | ||
|
|
||
| int main() { | ||
| std::cerr << boost::implicit_cast<long>(42) << '\n'; | ||
|
|
||
| std::unique_ptr<Base> base = std::make_unique<Derived>(); | ||
| std::cerr << boost::polymorphic_downcast<Derived&>(*base).name() << '\n'; | ||
|
|
||
| return 0; | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this and next jobs are required to check that using C++20 standard
import stdis not materialized