Skip to content

Consider using fmt to format and print strings #2951

@daljit46

Description

@daljit46

C++20 and C++23 have standardised std::format and std::print, making formatting and printing quite pythonic and nicer to use. These are the modern alternative to iostreams and the (IMO weird) use of shift operators. Our project is currently limited to C++17 so we cannot upgrade our code to use these new functions. However, these functions have been standardised based on fmt, which offers a header-only implementation that can be easily integrated into existing projects (it only requires C++11). I think we should consider using this in MRtrix3 for the formatting of strings and logging.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions