fix and improve module - #3386
Conversation
| #endif | ||
|
|
||
| FMT_BEGIN_NAMESPACE | ||
| FMT_BEGIN_EXPORT |
There was a problem hiding this comment.
The symbols below are undocumented and shouldn't be exported.
| } | ||
| }; | ||
| } // namespace detail | ||
| FMT_BEGIN_EXPORT |
There was a problem hiding this comment.
These are also undocumented APIs that we don't need to export yet.
| } | ||
|
|
||
| } // namespace detail | ||
| FMT_BEGIN_EXPORT |
There was a problem hiding this comment.
Here and a few other places: no need for a block, it's enough to mark the single definition here with FMT_MODULE_EXPORT.
* export public documented API * don't export `namespace detail` * add `std.h` into module * add missing namespace qualification in `xchar.h` * fix call to `detail::get_iterator` in `xchar.h` * fix ambiguous overload of `detail::isfinite` in `chrono.h`
| } | ||
| }; | ||
| } // namespace detail | ||
| FMT_BEGIN_EXPORT |
There was a problem hiding this comment.
We only have one class template here so I suggest applying FMT_MODULE_EXPORT to it.
| FMT_MODULE_EXPORT template <typename Context> class basic_format_arg; | ||
| FMT_MODULE_EXPORT template <typename Context> class basic_format_args; | ||
| FMT_MODULE_EXPORT template <typename Context> class dynamic_format_arg_store; |
There was a problem hiding this comment.
These are just forward declarations. Do we still need to export them if the main templates are exported?
There was a problem hiding this comment.
Names must be declared export when introduced into a namespace [module.interface]/6. The compiler will then collect all semantic properties that pertain to that entity that is referenced by the name. This collection continues throughout the whole module purview up to the end of the TU or the start of the private module fragment, whichever comes first.
In this case, the (forward) declarations introduce the names. So they need to be marked as exported at this very place in the source text.
This reminds me to remove the export declarations from the definitions of the primary templates 🤦♂️
|
Merged, thanks! |
namespace detailstd.hinto modulexchar.hdetail::get_iteratorinxchar.hdetail::isfiniteinchrono.h