-
Notifications
You must be signed in to change notification settings - Fork 10
Initial C++20 module implementation #72
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,48 @@ | ||||||||||||||||||||
| module; | ||||||||||||||||||||
|
|
||||||||||||||||||||
| #include <boost/corosio.hpp> | ||||||||||||||||||||
|
|
||||||||||||||||||||
|
Comment on lines
+1
to
+4
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🏁 Script executed: git ls-files | head -20Repository: cppalliance/corosio Length of output: 421 🏁 Script executed: # Find key files related to this review
fd -t f "corosio\.cppm|CMakeLists\.txt" | head -20Repository: cppalliance/corosio Length of output: 336 🏁 Script executed: # Look for the module interface file and main header
find . -name "*boost_corosio*" -o -name "corosio.hpp" | grep -E "\.(cpp|cppm|h|hpp)$"Repository: cppalliance/corosio Length of output: 119 🏁 Script executed: # Check the actual module interface file mentioned in the review
cat -n modules/boost_corosio.cppm 2>/dev/null || echo "File not found, searching for it..."Repository: cppalliance/corosio Length of output: 1450 🏁 Script executed: # Search for include/boost/corosio structure
fd -t f . include/boost/corosio 2>/dev/null | head -20Repository: cppalliance/corosio Length of output: 829 🏁 Script executed: # Read the main header file
cat -n include/boost/corosio.hpp | head -50Repository: cppalliance/corosio Length of output: 1276 🏁 Script executed: # Read the config header which likely defines the macros
cat -n include/boost/corosio/detail/config.hppRepository: cppalliance/corosio Length of output: 1651 🏁 Script executed: # Search for BOOST_COROSIO_USE_MODULES and BOOST_COROSIO_SOURCE usage in headers
rg -n "BOOST_COROSIO_USE_MODULES|BOOST_COROSIO_SOURCE" include/Repository: cppalliance/corosio Length of output: 2330 🏁 Script executed: # Check CMake configuration for the module unit
cat -n CMakeLists.txt | head -80Repository: cppalliance/corosio Length of output: 3406 🏁 Script executed: # Look for how modules/boost_corosio.cppm is built in CMake
rg -n "boost_corosio\.cppm|corosio.*INTERFACE_UNITS|CXX_MODULE" CMakeLists.txt test/CMakeLists.txtRepository: cppalliance/corosio Length of output: 194 🏁 Script executed: # Check what happens in one of the headers when the condition is true
cat -n include/boost/corosio/socket.hpp | head -40Repository: cppalliance/corosio Length of output: 1449 🏁 Script executed: # Search for "import boost.corosio" in headers to confirm the recursive import concern
rg -n "import\s+boost\.corosio" include/Repository: cppalliance/corosio Length of output: 1189 🏁 Script executed: # Check the CMakeLists around line 190 for context on how BOOST_COROSIO_SOURCE is defined for the module
sed -n '180,200p' CMakeLists.txtRepository: cppalliance/corosio Length of output: 860 🏁 Script executed: # Look for target_compile_definitions for boost_corosio related to BOOST_COROSIO_SOURCE
rg -n "target_compile_definitions.*boost_corosio|BOOST_COROSIO_SOURCE" CMakeLists.txtRepository: cppalliance/corosio Length of output: 743 🏁 Script executed: # Find the boost_corosio_setup_properties function to see if it applies BOOST_COROSIO_SOURCE
rg -n "boost_corosio_setup_properties" CMakeLists.txt -A 20Repository: cppalliance/corosio Length of output: 4487 🏁 Script executed: # Get more context around line 159 where BOOST_COROSIO_SOURCE is defined
sed -n '150,170p' CMakeLists.txtRepository: cppalliance/corosio Length of output: 843 🏁 Script executed: # Look for any place where BOOST_COROSIO_SOURCE is set for the module interface
rg -n "modules/boost_corosio\.cppm\|FILE_SET.*CXX_MODULES" CMakeLists.txt -B 5 -A 10Repository: cppalliance/corosio Length of output: 45 Add When Suggested fix module;
+#define BOOST_COROSIO_SOURCE 1
`#include` <boost/corosio.hpp>
+#undef BOOST_COROSIO_SOURCE📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||
| export module boost.corosio; | ||||||||||||||||||||
|
|
||||||||||||||||||||
| export namespace boost::corosio { | ||||||||||||||||||||
|
|
||||||||||||||||||||
| using corosio::acceptor; | ||||||||||||||||||||
| using corosio::endpoint; | ||||||||||||||||||||
| using corosio::io_buffer_param; | ||||||||||||||||||||
| using corosio::io_context; | ||||||||||||||||||||
| using corosio::io_object; | ||||||||||||||||||||
| using corosio::io_stream; | ||||||||||||||||||||
| using corosio::read; | ||||||||||||||||||||
| using corosio::resolve_flags; | ||||||||||||||||||||
| using corosio::resolver; | ||||||||||||||||||||
| using corosio::resolver_entry; | ||||||||||||||||||||
| using corosio::resolver_results; | ||||||||||||||||||||
| using corosio::signal_set; | ||||||||||||||||||||
| using corosio::socket; | ||||||||||||||||||||
| using corosio::tcp_server; | ||||||||||||||||||||
| using corosio::timer; | ||||||||||||||||||||
| using corosio::write; | ||||||||||||||||||||
| using corosio::operator|; | ||||||||||||||||||||
| using corosio::operator&; | ||||||||||||||||||||
| using corosio::operator&=; | ||||||||||||||||||||
| using corosio::operator|=; | ||||||||||||||||||||
|
|
||||||||||||||||||||
| // I think this should be in tls | ||||||||||||||||||||
| using corosio::tls_stream; | ||||||||||||||||||||
| using corosio::openssl_stream; | ||||||||||||||||||||
| using corosio::wolfssl_stream; | ||||||||||||||||||||
|
Comment on lines
+30
to
+33
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Remove or clarify the inline note. 🧹 Suggested cleanup-// I think this should be in tls
-
using corosio::tls_stream;
using corosio::openssl_stream;
using corosio::wolfssl_stream;🤖 Prompt for AI Agents |
||||||||||||||||||||
|
|
||||||||||||||||||||
| namespace tls { | ||||||||||||||||||||
| using corosio::tls::context; | ||||||||||||||||||||
| using corosio::tls::file_format; | ||||||||||||||||||||
| using corosio::tls::password_purpose; | ||||||||||||||||||||
| using corosio::tls::revocation_policy; | ||||||||||||||||||||
| using corosio::tls::role; | ||||||||||||||||||||
| using corosio::tls::verify_mode; | ||||||||||||||||||||
| using corosio::tls::version; | ||||||||||||||||||||
| } // namespace tls | ||||||||||||||||||||
|
|
||||||||||||||||||||
|
|
||||||||||||||||||||
| } // namespace boost::corosio | ||||||||||||||||||||
|
|
||||||||||||||||||||
|
|
||||||||||||||||||||
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.
🧩 Analysis chain
🌐 Web query:
CMake FILE_SET CXX_MODULES minimum version requirement💡 Result:
Official (non-experimental) minimum CMake version for
FILE_SET TYPE CXX_MODULES:3.28— theCXX_MODULESfile-set type fortarget_sources(FILE_SET ...)was added in CMake 3.28. (cmake.org)Earlier versions: CMake had experimental C++ modules support (gated by
CMAKE_EXPERIMENTAL_CXX_MODULE_CMAKE_API) before 3.28, but the stableFILE_SET TYPE CXX_MODULESfeature is 3.28+. (kitware.com)Citations:
🏁 Script executed:
Repository: cppalliance/corosio
Length of output: 809
🏁 Script executed:
Repository: cppalliance/corosio
Length of output: 293
🏁 Script executed:
Repository: cppalliance/corosio
Length of output: 106
Add CMake version guard for C++20 modules support.
FILE_SET CXX_MODULESrequires CMake 3.28+, but the project's minimum version is 3.16 (line 16). If a user enablesBOOST_COROSIO_USE_MODULESwith CMake < 3.28, they'll get a confusing error.Proposed fix: add version check
🤖 Prompt for AI Agents