Conversation
`sus` is an experimental module interface unit. `import sus;` replaces including most conventional Subspace headers. Users will need to include headers suffixed with `_macros.h` in order to use Subspace modules, but should not include any headers otherwise.
| target_sources(${SUS_NAME} PUBLIC | ||
| FILE_SET CXX_MODULES | ||
| FILES "sus.cc" | ||
| ) |
There was a problem hiding this comment.
I see the first add_library has all the .cc files except this one. The target_sources has all the .h and .cc files except this one. And then we repeat target_sources with this one. Can we add a comment so when adding a new file it's clear where to put it in this file?
| import sus; | ||
|
|
||
| # include "fmt/format.h" | ||
| # include "sus/assertions/check.h" |
There was a problem hiding this comment.
I was expecting only _macros.h headers when using module, how come this is here?
| #ifdef TEST_MODULE | ||
| import sus; | ||
|
|
||
| # include "fmt/format.h" |
There was a problem hiding this comment.
Should this just move outside the ifdef entirely?
| #include <sstream> | ||
| #include "fmt/format.h" |
There was a problem hiding this comment.
| #include <sstream> | |
| #include "fmt/format.h" | |
| #include <sstream> | |
| #include "fmt/format.h" |
| #include "sus/choice/macros.h" | ||
| #include "sus/macros/__private/compiler_bugs.h" |
There was a problem hiding this comment.
Should these move outside the ifdef?
| // limitations under the License. | ||
| module; |
There was a problem hiding this comment.
| // limitations under the License. | |
| module; | |
| // limitations under the License. | |
| module; |
| // See the License for the specific language governing permissions and | ||
| // limitations under the License. | ||
| module; | ||
| #include "sus/assertions/check.h" |
There was a problem hiding this comment.
Can we add a comment explaining which headers appear here (everything except macros headers)?
| using sus::mem::remove_rvalue_reference; | ||
|
|
||
| namespace __private { | ||
| using sus::mem::__private::HasCloneFromMethod; |
There was a problem hiding this comment.
How come private stuff has to be in here? Can it be made reachable without being visible? (https://vector-of-bool.github.io/2019/03/31/modules-2.html)
| namespace __private { | ||
| using sus::choice_type::__private::find_choice_storage_mut; | ||
| using sus::choice_type::__private::find_choice_storage; | ||
| using sus::choice_type::__private::TypeList; | ||
| using sus::choice_type::__private::MakeStorageType; | ||
| using sus::choice_type::__private::StorageIsSafelyConstructibleFromReference; | ||
| using sus::choice_type::__private::AllValuesAreUnique; | ||
| } |
There was a problem hiding this comment.
| namespace __private { | |
| using sus::choice_type::__private::find_choice_storage_mut; | |
| using sus::choice_type::__private::find_choice_storage; | |
| using sus::choice_type::__private::TypeList; | |
| using sus::choice_type::__private::MakeStorageType; | |
| using sus::choice_type::__private::StorageIsSafelyConstructibleFromReference; | |
| using sus::choice_type::__private::AllValuesAreUnique; | |
| } | |
| namespace __private { | |
| using sus::choice_type::__private::find_choice_storage_mut; | |
| using sus::choice_type::__private::find_choice_storage; | |
| using sus::choice_type::__private::TypeList; | |
| using sus::choice_type::__private::MakeStorageType; | |
| using sus::choice_type::__private::StorageIsSafelyConstructibleFromReference; | |
| using sus::choice_type::__private::AllValuesAreUnique; | |
| } |
| export using ::sus::panic; | ||
| export using ::sus::unreachable; | ||
| export using ::sus::unreachable_unchecked; |
There was a problem hiding this comment.
| export using ::sus::panic; | |
| export using ::sus::unreachable; | |
| export using ::sus::unreachable_unchecked; | |
| export using sus::panic; | |
| export using sus::unreachable; | |
| export using sus::unreachable_unchecked; |
This file is consistently not using the leading :: otherwise, and that seems fine for using decls.
susis an experimental module interface unit.import sus;replaces including most conventional Subspace headers. Users will need to include headers suffixed with_macros.hin order to use Subspace modules, but should not include any headers otherwise.