https://github.com/fenglielie/allay
modern C++ utils
https://github.com/fenglielie/allay
cpp cpp20 modern-cpp
Last synced: over 1 year ago
JSON representation
modern C++ utils
- Host: GitHub
- URL: https://github.com/fenglielie/allay
- Owner: fenglielie
- Created: 2024-04-17T08:54:48.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2025-03-12T04:12:27.000Z (over 1 year ago)
- Last Synced: 2025-03-12T05:19:32.453Z (over 1 year ago)
- Topics: cpp, cpp20, modern-cpp
- Language: C++
- Homepage:
- Size: 174 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Allay
Allay is a collection of small C++ tools for practice, provided as header-only libraries unless otherwise specified.
- **mtest**: A header-only testing framework mimicking gtest.
- **safe_input**: A component ensuring safe input handling.
- **msignal**: An observer pattern implementation for signal transmission.
- **mlog**: A simple logging library.
- **data_handler**: A component for reading and writing data files.
- **var_type_dict**: A heterogeneous dictionary based on template metaprogramming (reference: 《C++模板元编程实战:一个深度学习框架的初步实现》).
- **simple_thread_pool**: A simple C++ thread pool ([reference](https://www.limerence2017.com/2023/09/17/concpp07/)).
- **mtracer**: A simple function call stack tracing component (using C++20's `std::source_location` instead of traditional `__FILE__` and others).
- **mparser**: A simple command-line parser.
- **ini_parser**: A simple INI file parser.
- **pbar**: A simple command-line progress bar display.
- **windows_console**: A Windows-specific utility for handling console input/output with UTF-8 encoding and virtual terminal sequences. ([reference 1](https://chariri.moe/archives/408/windows-cin-read-utf8/), [reference 2](https://stackoverflow.com/questions/48176431/reading-utf-8-characters-from-console))
- **colorful**: A C++ library for adding color to console output.
- **mtimer**: A simple timer component.
---
| compiler | version | flags |
| -------- | ------- | ---------- |
| clang | 18.0.0 | -std=c++20 |
| gcc | 13.0.0 | -std=c++20 |
| MSVC | 2022 | /std:c++20 |
generate and build (cmake version >= 3.15)
```bash
cmake -S . -B build
cmake --build ./build -j8
```
test
```bash
cd ./build
ctest -j8
```
run xxx demo
```bash
./bin/xxx_demo
```
install
```bash
cmake -S . -B build -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX="~/.local/"
cmake --build build --target install
```
usage
```cmake
find_package(allay QUIET)
if(NOT allay_FOUND)
include(FetchContent)
FetchContent_Declare(
allay
GIT_REPOSITORY https://github.com/fenglielie/allay.git
# GIT_REPOSITORY git@github.com:fenglielie/allay.git
GIT_TAG main
DOWNLOAD_EXTRACT_TIMESTAMP TRUE
)
FetchContent_MakeAvailable(allay)
endif()
add_executable(demo demo.cpp)
target_link_libraries(demo PRIVATE allay::pbar)
```