Giter Site home page Giter Site logo

itlib's Introduction

itlib: iboB's Template Libraries

A collection of small single-header C++ libraries similar to or extending the C++ standard library. See below for a list.

Language License

itlib was forked from chobo-shl which is no longer supported. New libraries and updates to the existing ones are added here.

Build Status

Building with GitHub actions on Windows with MSVC, Ubuntu with GCC, and macOS with clang. Debug and Release. With address sanitizer.

Build

Libraries

Every .hpp file in include/itlib is a standalone library and has no dependencies other than the standard lib.

Documentation is provided in comments at the top of each file.

In the list below each library shows its minimum supported C++ standard and has icons for other standards if additional features are available for them.

Library Description
dynamic_bitset.hpp Standard A class similar to std::bitset, but the number of bits is not a part of the type. It's also somewhat similar to std::vector<bool>;, but (so far) it has more limited modification capabilities.
flat_map.hpp Standard A class with the interface of std::map but implemented with an underlying std::vector-type container, thus providing better cache locality of the elements. Similar to boost::flat_map with the notable difference that the underlying container can be changed via a template argument (thus making the class not strictly an std::map drop-in replacement)
make_ptr.hpp Standard Small helper functions for creating std::shared_ptr and std::unique_ptr which make the code shorter and more readable.
mem_streambuf.hpp Standard Two helper classes: mem_ostreambuf and mem_istreambuf which allow you to work with std::stream-s with buffers of contiguous memory.
memory_view.hpp Standard A class which provides a std::vector like interface (sans the methods which might change the size or capacity) to a chunk of memory. Similar to C++20's std::span
pod_vector.hpp Standard A container similar to std::vector, which contains PODs. This fact is used to improve performance by skipping constructor and destructor calls and using memcpy and memmove to copy data, and malloc and free, and, most importantly realloc, to manage memory.
qalgorithm.hpp Standard Wrappers of <algorithm> functions which work on entire containers for less typing in the most common use-cases.
rstream.hpp Standard Read stream. Simple std::istream wrappers which don't allow seeks, allowing you to be certain that reads are sequential, and thus allow a redirect, so you can represent several streams as one.
sentry.hpp Standard Standard A sentry class which executes a function object on destruction. Works with C++11, but it's slightly easier to use with C++17.
small_vector.hpp Standard A mix between std::vector and itlib::static_vector. It's a dynamic array, optimized for use when the number of elements is small. Like static_vector is has a static buffer with a given capacity, but can fall back to dynamically allocated memory, should the size exceed it. Similar to boost::small_vector
static_vector.hpp Standard A mix between std::vector and std::array: A dynamically sized container with fixed capacity (supplied as a template parameter). This allows you to have dynamically sized vectors on the stack or as cache-local value members, as long as you know a big enough capacity beforehand. Similar to boost::static_vector.
time_t.hpp Standard A thin wrapper of std::time_t which provides thread safe std::tm getters and type-safe (std::chrono::duration-based) arithmetic
type_traits.hpp Standard Standard Additional type traits to extend the standard library's <type_traits>
ufunction.hpp Standard Standard Unique function. A replacement of std::function which is non-copyable (can capture non-copyable values, and wrap non-copyable objects), and noexcept move-constructible (won't implicitly make owners no-noexcept move-constructible)

Usage

Clone the repo or choose one or more libraries that you like and copy them somewhere in your include paths.

Every library is self-contained so you can copy, move, and modify whichever you like and not wory about interdependencies.

Contributing

Pull requests and issues are welcome.

Please make one pull request and issue per library, tagging them with the library name in the title with brackets. Example:

  • [small_vector] Added insert methods
  • [flat_map] Crash when using with xxxx container

You can use CMake to generate a project and run the tests locally.

Copyright

Copyright © 2016-2019 Chobolabs Inc.

Copyright © 2020-2021 Borislav Stanimirov

These libraries are distributed under the MIT Software License. See LICENSE.txt for further details or copy here.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.