tesseract icon indicating copy to clipboard operation
tesseract copied to clipboard

RFC: Use std::format / fmtlib

Open amitdo opened this issue 1 year ago • 7 comments

This is for 6.0.

See https://github.com/tesseract-ocr/tesseract/pull/3684#issuecomment-999690035

Use std::format when the used STL supports it, fallback to fmtlib otherwise.

MSVC has full support for std::format. Clang has almost complete support. Currently, it is considered experimental, but will likely be stable before we release 6.0.

amitdo avatar Jul 25 '22 06:07 amitdo

See branch libfmt for a partial implementation that could also be used for release 5.x.

stweil avatar Jul 25 '22 08:07 stweil

gcc does not implement it yet. So, possible gcc versions are gcc13 or higher.

egorpugin avatar Jul 25 '22 09:07 egorpugin

I compiled the libfmt branch with gcc-10 on Debian stable.

stweil avatar Jul 25 '22 09:07 stweil

https://blog.llvm.org/posts/2022-08-14-libc++-format/

amitdo avatar Sep 30 '22 15:09 amitdo

https://www.reddit.com/r/cpp/comments/yugvlf/gcc_13_will_have_format/

amitdo avatar Nov 27 '22 04:11 amitdo

https://libcxx.llvm.org/ReleaseNotes/17.html#improvements-and-new-features

The header is no longer considered experimental. Some std::formatter specializations are not yet available since the class used in the specialization has not been implemented in libc++. This prevents the feature-test macro to be set.

amitdo avatar Nov 09 '23 10:11 amitdo

https://github.com/tesseract-ocr/tesseract/tree/libfmt is now based on the latest code from https://github.com/fmtlib/fmt.

stweil avatar Nov 11 '23 19:11 stweil