Ajatt-Tools / gd-tools

🍣 A set of tools to enhance GoldenDict.
https://tatsumoto.neocities.org/blog/setting-up-goldendict#gd-tools
GNU General Public License v3.0
35 stars 6 forks source link

fmtlib replaced with std::format #22

Closed xieamoe closed 7 months ago

xieamoe commented 7 months ago

libFmt causes compilation and linking errors on Windows, Fedora 39, Guix, Freebsd. C++23 includes std::format which can replace it.

This patch removes dependency on fmt and introduces replacement functions for fmt::print and fmt::println making gd-tools ready to be cross platform and less prone to OS/Distro specific library issues.

However, it looks like ranges are not yet supported in std::format and I don't know how to implement it. Check mecab_split.cpp at line 186, I can't test gd-mecab since it's not working on my OS

tatsumoto-ren commented 7 months ago

However, it looks like ranges are not yet supported in std::format and I don't know how to implement it.

I think we can write a join function.