{"id":18654033,"url":"https://github.com/thebashpotato/etl","last_synced_at":"2026-02-19T18:32:38.782Z","repository":{"id":169675155,"uuid":"645526071","full_name":"thebashpotato/etl","owner":"thebashpotato","description":"A toolkit of templated classes which solve common programming problems in C++","archived":false,"fork":false,"pushed_at":"2024-12-26T07:10:04.000Z","size":153,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-10-17T10:16:47.810Z","etag":null,"topics":["cmake","cpp-programming","cpp-result","cpp17-library","cpp20-library","header-only-library"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/thebashpotato.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-05-25T21:20:30.000Z","updated_at":"2024-12-26T07:06:37.000Z","dependencies_parsed_at":"2024-05-18T20:30:29.447Z","dependency_job_id":"80246699-4e24-43a6-977f-f220d8f35c6d","html_url":"https://github.com/thebashpotato/etl","commit_stats":null,"previous_names":["thebashpotato/etl","thebashpotato/extra-template-library"],"tags_count":12,"template":false,"template_full_name":null,"purl":"pkg:github/thebashpotato/etl","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thebashpotato%2Fetl","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thebashpotato%2Fetl/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thebashpotato%2Fetl/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thebashpotato%2Fetl/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/thebashpotato","download_url":"https://codeload.github.com/thebashpotato/etl/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thebashpotato%2Fetl/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29627112,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-19T18:02:07.722Z","status":"ssl_error","status_checked_at":"2026-02-19T18:01:46.144Z","response_time":117,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cmake","cpp-programming","cpp-result","cpp17-library","cpp20-library","header-only-library"],"created_at":"2024-11-07T07:13:49.802Z","updated_at":"2026-02-19T18:32:38.748Z","avatar_url":"https://github.com/thebashpotato.png","language":"C++","readme":"\u003cdiv align=\"center\"\u003e\n  \u003cimg width=\"500\" height=\"500\" src=\"logo.png\"\u003e\n\u003c/div\u003e\n\u003cdiv align=\"center\"\u003e\n  \u003cimg alt=\"GitHub Workflow Status (with event)\" src=\"https://img.shields.io/github/actions/workflow/status/thebashpotato/etl/cmake.yml?style=flat-square\u0026logo=ubuntu\u0026label=Build%20Status\"\u003e\n  \u003cimg src=\"https://img.shields.io/badge/standard--readme-OK-green.svg?style=flat-square\"\u003e\n  \u003cimg alt=\"GitHub Release Date - Published_At\" src=\"https://img.shields.io/github/release-date/thebashpotato/etl?style=flat-square\"\u003e\n  \u003cimg alt=\"GitHub\" src=\"https://img.shields.io/github/license/thebashpotato/etl?style=flat-square\"\u003e\n  \u003cimg alt=\"Github\" src=\"https://img.shields.io/badge/C++-17, 20, 23-blue.svg?style=flat-square\u0026logo=c%2B%2B\"\u003e\n  \u003cbr\u003e\n  \u003cp\u003e\u003cb\u003eExtra Templated Library\u003c/b\u003e for modern C++ development\u003c/p\u003e\n\u003c/div\u003e\n\n## Table of Contents\n\n- [Etl](#etl)\n- [Integration](#integration)\n- [Usage](#usage)\n- [Maintainers](#maintainers)\n- [Contributing](#contributing)\n- [License](#license)\n\n## Etl\n\nEtl contains classes that rely on C++ \u003e= 17 to solve common programming problems that the language does not technically have\nbuilt in support for. This library has **zero** external dependencies and was born out of my frustration at work and personal projects, as I constantly had to come up with\ncustom solutions to fix the common problems I ran into, I finally put them all together in this `BSD-Clause-3` licensed single header templated library.\nHopefully they solve some of your problems, and speed up your development.\n\n### What does this library contain?\n\nPlease checkout the unit-tests and example code for use cases and implementations, also don't be afraid to read the source code,\nits a single header file, at roughly 798 lines of code. A nice and easy read with descriptive comments.\n\n1. [etl::Result\u003cT, E\u003e](https://github.com/thebashpotato/etl/blob/2510c16bfcf22b4730ace5f7337c6d51adbc53a0/etl/include/etl.hpp#L586)\n\n- Don't like or don't want to use C++'s exception handling paradigm for errors? Cool, then you don't have to, \n  the `etl::Result\u003cT, E\u003e` attempts to be as close to the Rust langauges implementation as possible,\n  and may be just what your looking for to ditch those try/catch error handling blocks.\n\n- If you are thinking, how do I handle returning a `Result\u003cT, E\u003e` from my `void` routines, it's easy. etl supplies a stub type called `etl::Void`\n  (it is just an empty class).\n\n```cpp\n// Old code which throws an exception\nvoid DoTheThing(const bool thing)\n{\n    if (thing)\n    {\n        std::cout \u003c\u003c \"Doing the thing\" \u003c\u003c '\\n';\n        // more code\n        return;\n    }\n\n    throw std::runtime_error(\"Couldn't do the thing\");\n}\n\nusing namespace etl;\n\n// New code ported to use etl::Result\u003cT, E\u003e\n[[nodiscard]] auto DoingTheThingBetter(const bool thing) noexcept -\u003e Result\u003cVoid, BaseError\u003e\n{\n    if (thing)\n    {\n        std::cout \u003c\u003c \"Doing the thing\" \u003c\u003c '\\n';\n        // more code\n        return Result\u003cVoid, BaseError\u003e(Void());\n    }\n\n    return Result\u003cVoid, BaseError\u003e({\"Still couldn't do the thing\", RUNTIME_INFO});\n}\n\n// Let's compare the code using both functions\nauto main() -\u003e int\n{\n    try\n    {\n        DoTheThing(false);\n        // Hey we can continue..\n    }\n    catch (const std::runtime_error \u0026e)\n    {\n        std::cerr \u003c\u003c e.what() \u003c\u003c '\\n';\n    }\n\n    if (auto result = DoingTheThingBetter(false); result.is_ok())\n    {\n        // Hey we can continue..\n        \n        // You could get the underlying object, but the point is that it's void\n        [[maybe_unused]] Void void_type = result.ok().value();\n    } \n    else \n    {\n        std::cerr \u003c\u003c result.err().value().info() \u003c\u003c '\\n'\n    }\n\n\n}\n```\n\n- One current catch with the `etl::Result\u003cT, E\u003e` type is if you have a **move only type** you will need to \"hi-jack\" the etl namespace\n  and create a template specialization for `Result\u003cYourMoveOnlyType, E\u003e`, but don't worry it's easy. \n  I have provided an example [here](https://github.com/thebashpotato/etl/blob/2510c16bfcf22b4730ace5f7337c6d51adbc53a0/etl/examples/moveonly/moveonly.hpp#L12) which you can copy and paste, (Just replace the name of the the namespaced class with your own).\n\n2. [etl::EnumerationIterator\u003cIteratorName, IteratorBegin, IteratorEnd\u003e](https://github.com/thebashpotato/etl/blob/main/etl/tests/enum_iterable_test.cpp)\n\n- Want to use modern C++'s ranged for loops to iterate over an enum safely? There is a templated class for that.\n\n- Be aware that your enum **MUST** be contiguous otherwise`EnumerationIterator` won't work.\n\n3. [etl::TaggedFundamentalType\u003cTag, FundamentalType\u003e](https://github.com/thebashpotato/etl/blob/main/etl/tests/tagged_type_test.cpp)\n\n- Do you have many parameters to a function or constructor of the same type contiguously\n  (common when representing geometrical objects such as a Rectangle)? This can result in programmer error by\n  accidently passing in values for the wrong parameter, a common solution is to tag your types.\n  etl makes the process generic, quick and easy.\n\n- The TaggedFundamentalType supports all arithmetic, boolean and bitwise operator overloads.\n\n4. [etl::BaseError](https://github.com/thebashpotato/etl/blob/2510c16bfcf22b4730ace5f7337c6d51adbc53a0/etl/include/etl.hpp#L512)\n\n- An Abstract error class that supports source code location in yours errors, using the function, line and file macros.\n  You can easily override all the methods, but will likely be uneeded. Just define two constructors and you're on your way.\n\n- Example of using the BaseError class in your code.\n\n  ```cpp\n  #include \u003ciostream\u003e\n  #include \u003cetl.hpp\u003e \n\n  namespace YourApp {\n\n  class Error : public etl::BaseError\n  {\n    public:\n      explicit Error(const std::string_view \u0026msg) noexcept : etl::BaseError(msg)\n      {\n      }\n\n      Error(const std::string_view \u0026msg, const etl::SourceCodeLocation \u0026slc) noexcept : etl::BaseError(msg, slc)\n      {\n      }\n  };\n  } // namespace YourApp\n\n  auto main() -\u003e int\n  {\n      // Create a basic error\n      YourApp::Error first_error(\"My custom message\");\n      std::cout \u003c\u003c first_error.msg() \u003c\u003c '\\n';\n\n      // Create an error with the correct source code location (file, function name, line, supplied by the convenience macro RUNTIME_INFO) \n      // of where the error was constructed.\n      YourApp::Error second_error(\"Another error with information\", etl::RUNTIME_INFO);\n      std::cout \u003c\u003c second_error.info() \u003c\u003c '\\n';\n\n      return 0;\n  }\n  ```\n\n\n- A basic error class that supports source code location in your errors, using the function, line, and file macros.\n  This makes it much easier to provide usefull runtime error information as it captures the above information through use of a custom source code location macro called\n  [etl::RUNTIME_INFO](https://github.com/thebashpotato/etl/blob/2510c16bfcf22b4730ace5f7337c6d51adbc53a0/etl/include/etl.hpp#L502) macro which the BaseError class supports.\n\n- `etl::DynError` a type definition which is just a `std::shared_ptr\u003cBaseError\u003e` to support returning polymorphic errors up a function call chain with less typing.\n   ```cpp\n   [[nodiscard]] auto SomeClass::SomeMethod() noexcept -\u003e etl::Result\u003cstd::string, etl::DynError\u003e;\n   ```\n\n\n## Integration\n\n\n[Copy the single header file](etl/include/etl.hpp) into your project.\n\nOr you can download the `etl.hpp` file from the latest [Releases](https://github.com/thebashpotato/etl/releases)\n\n### Install globally on your system (assuming you're on Linux or a BSD)\n\nWill install the single header file and Cmake configuration modules, which `find_package` can use.\n\n```bash\nmake install\n\n# Example output\n-- Install configuration: \"Release\"\n-- Up-to-date: /usr/local/include\n-- Up-to-date: /usr/local/include/etl.hpp\n-- Installing: /usr/local/share/pkgconfig/etl.pc\n-- Installing: /usr/local/share/cmake/etl/etlConfigVersion.cmake\n-- Installing: /usr/local/share/cmake/etl/etlConfig.cmake\n-- Installing: /usr/local/share/cmake/etl/etlTargets.cmake\n```\n\nTo remove on linux (relies on xargs)\n\n```bash\nmake uninstall\n```\n\n### Cmake\n\n### Find Package (assuming it has been installed globally on your system)\n\n```cmake\nfind_package(etl 0.8.4 REQUIRED)\n\n# Your Application linking cmake code\ntarget_link_libraries(\n  your_awesome_project\n  PRIVATE etl::etl)\n```\n\n#### CPM (The package manager way)\n\nPlease check out how to use [CPM](https://github.com/cpm-cmake/CPM.cmake) it is dead simple.\n\n```cmake\ncpmaddpackage(\"gh:thebashpotato/etl#v0.8.4\")\n\n# Your Application linking cmake code\ntarget_link_libraries(\n  your_awesome_project\n  PRIVATE etl::etl)\n```\n\n### Package Config\n\n#### Cmake\n\n```cmake\nfind_package(PkgConfig REQUIRED IMPORTED_TARGET GLOBAL)\npkg_check_modules(Etl REQUIRED etl)\n\n# Your Application linking cmake code\ntarget_link_libraries(your_awesome_project PUBLIC PkgConfig::Etl)\ntarget_include_directories(your_awesome_project PUBLIC ${Etl_INCLUDE_DIRS})\n```\n\n#### Bare Makefile\n\nIf you are using bare Makefiles, you can use `pkg-config` to generate the include flags that point to where the library is installed.\n\n```bash\npkg-config etl --cflags\n```\n\n## Usage\n\n1. [Please see the unit tests](etl/tests) for bite size examples for each class.\n\n2. [Please see](etl/examples/blackjack) for an example blackjack program utilizing etl to solve real world problems.\n\n3. [Please see](etl/examples/moveonly) for an example for a Result\u003cT, E\u003e move only class template specialization.\n\n```cpp\n#include \u003cetl.hpp\u003e\n```\n\n## Maintainers\n\n[@thebashpotato](https://github.com/thebashpotato)\n\n## Contributing\n\nDo you have an idea for something usefull that other C++ programmers would need? Please open an issue, or a Pull Request.\n\nSmall note: If editing the README, please conform to the [standard-readme](https://github.com/RichardLitt/standard-readme) specification.\n\n## License\n\nBSD-Clause-3 © 2024 Matt Williams\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthebashpotato%2Fetl","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthebashpotato%2Fetl","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthebashpotato%2Fetl/lists"}