scnlib
scanf for modern C++ (by eliaskosunen)
tinyformat
Minimal, type safe printf replacement library for C++ (by c42f)
Our great sponsors
scnlib | tinyformat | |
---|---|---|
18 | 4 | |
920 | 517 | |
- | - | |
9.4 | 0.0 | |
9 days ago | about 2 months ago | |
C++ | C++ | |
Apache License 2.0 | - |
The number of mentions indicates the total number of mentions that we've tracked plus the number of user suggested alternatives.
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
scnlib
Posts with mentions or reviews of scnlib.
We have used some of these posts to build our list of alternatives
and similar projects. The last one was on 2023-12-07.
-
Why are strings and IO so complicated?
scnlib (https://github.com/eliaskosunen/scnlib) scanf
- Reddit++
-
CPM.cmake to make CMake's FetchContent easier
include(FetchContent) FetchContent_Declare( Catch2 GIT_REPOSITORY https://github.com/catchorg/Catch2.git GIT_TAG v3.0.0-preview4 ) FetchContent_Declare( fmt GIT_REPOSITORY https://github.com/fmtlib/fmt.git GIT_TAG 9.1.0 ) FetchContent_Declare( scnlib GIT_REPOSITORY https://github.com/eliaskosunen/scnlib.git GIT_TAG v1.1.2 ) FetchContent_MakeAvailable(Catch2 fmt scnlib)
-
[C++20] ClearIO library (unfinished)
Yeah, but parsing format strings in runtime induces an overhead, and doing it in compile time is not trivial, and I’m not sure ClearIO is worth the trouble, since it turns out scnlib exists.
-
My AoC2021 solutions in C++
The code is rather nice (in my biased opinion) and makes heavy use of a couple of libraries like scnlib and [Eigen](eigen.tuxfamily.org/). Some things could probably be more optimized but I mainly focused on conciseness. I hope this is useful and I can explain my thought process further if you have any questions.
-
what annoys you most while using c++?
I've found https://github.com/eliaskosunen/scnlib but haven't tested it. Maybe that suits your needs for 2.
-
The Year is 2022 and the Standard is C++20; what is your preferred way to do Text I/O?
I had a user enum like enum class Color {Red, Green, Blue}; that I wanted to add serialization support for. Following the docs (https://scnlib.readthedocs.io/), after some tweaks I arrived at the following:
-
scnlib (scanf for modern C++) - version 1.0 released
Thanks for the comment, I made an issue tracking this: https://github.com/eliaskosunen/scnlib/issues/51
tinyformat
Posts with mentions or reviews of tinyformat.
We have used some of these posts to build our list of alternatives
and similar projects. The last one was on 2022-08-03.
-
I’m about to start learning C++
printf has some pretty serious security implications. When I want more complicated text printing options than what is easy or terse in iostream then I use the tinyformat library.
-
The Year is 2022 and the Standard is C++20; what is your preferred way to do Text I/O?
The usual way I do I/O is via combining C++ stringstremas with either tinyformat or via an implementation of p0117 "variadic to_[basic_]string, depending on the particular need.
-
[Belay the C++] Yet another reason to not use printf (or write C code in general)
Haven't been able to make it work with MSVC 2012 (the earliest Windows-side compiler I need to support). I myself use tinyformat instead.
-
Is there a real benefit to using cout as opposed to printf that offsets the extra work in formatting?
However, not all is lost. While there are libraries like {fmt} I don't pay attention to them because they are far away into The Future and unusable with my requirements (C++03 support at the earliest, work reasons). Most newfangled libs I've seen are intended for Compilers of the Future, for C++20/C++23 and the like, and with that among other reasons are not generic enough for me. Instead I just use tinyformat that lays on top of both and bridges them, not to mention the biggest sell that is rrtaining the POSIX style printf notation (why didn't {fmt} go with that is still a mystery to me).
What are some alternatives?
When comparing scnlib and tinyformat you can also consider the following projects:
C++ Format - A modern formatting library
gainput - Cross-platform C++ input library supporting gamepads, keyboard, mouse, touch
cpp-peglib - A single file C++ header-only PEG (Parsing Expression Grammars) library
blackboxwm - A window manager for X11
printf-tac-toe - tic-tac-toe in a single call to printf
papers - ISO/IEC JTC1 SC22 WG21 paper scheduling and management
aoc2021 - Advent of Code 2021
AnyAny - C++17 library for comfortable and efficient dynamic polymorphism
libflow
libcfg-cpp - A minimalistic configuration manager for C++ projects.