axom
axom copied to clipboard
With C++17, compile error because fmt has deprecated arg_mapper<Context>::map
A host code trying to compile using MSVC and C++17 ran into this error, within inlet:
Error C4996 'axom::fmt::v9::detail::arg_mapper<Context>::map': was declared deprecated d:\path\to\axom\src\thirdparty\axom\fmt\core.h 1737
Others have encountered this: https://github.com/fmtlib/fmt/issues/3183. The response from the fmt project was as follows:
You need to make EnumTest formattable via format_as or formatter specialization. Please see the docs for more details: https://fmt.dev/latest/api.html#formatting-user-defined-types.
Was the enum in inlet
or in the host code? In either case, I think this should be fairly easy to resolve.
We've added fmt::formatter
s in a few places within axom, e.g. for the primal::Point
class.
See, e.g.:
- https://github.com/LLNL/axom/blob/c36a089e8fd0672c43e95ca9e22bb93708132032/src/axom/primal/geometry/Point.hpp#L337-L340
- https://github.com/search?q=repo%3ALLNL%2Faxom%20fmt%3A%3Aformatter&type=code
Good question. This may have been user code trying to format an Inlet object. Thanks for the links.