MRtrix3 / mrtrix3

MRtrix3 provides a set of tools to perform various advanced diffusion MRI analyses, including constrained spherical deconvolution (CSD), probabilistic tractography, track-density imaging, and apparent fibre density
http://www.mrtrix.org
Mozilla Public License 2.0
294 stars 181 forks source link

Consider using fmt to format and print strings #2951

Open daljit46 opened 3 months ago

daljit46 commented 3 months ago

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.

daljit46 commented 3 months ago

Additionally for logging, spdlog would also be nice.