SkillAgentSearch skills...

Stdex

std C++ 11 library impementation with extra features using only C++ 98 and POSIX threads

Install / Use

/learn @oktonion/Stdex

README

CI Status and tests coverage

Branch | Appveyor| Github | Codecov ---------|---------|---------|--------- tests (development) | Build Status | C/C++ CI| codecov master | Build Status | C/C++ CI | codecov

CodeQL | Codacy Badge

stdex

logo

language

C++ 11 standard library implementation with extra features using C++98 only and POSIX threads. Minimum ugly preprocessor macro and no configuration files. The library itself is built on top of C++ standard library distributed with your compiler and just extends it with C++11 features.

Usage examples on Wiki

Supported platforms

  • Windows (from XP to 10)
  • Unix (any with glibc and pthread)
  • MacOS (any)
  • QNX 6.x.x
  • QNX 4 (partly)

Wiki for more details.

Q: Why not Boost?

A:

  1. Because I can.
  2. Because I need something without such overhead and ugliness (ugliness and beauty actually, I am really amazed by how Boost handles some features of C++).
  3. Because I want all of basic little helpful classes and tricks (as countof f.e.) be in one place with power of C++ 11 threads handling and template-programming.
<details> <summary><b>C++ 11 implemented features list</b></summary>

Language core

  • nullptr and stdex::nullptr_t
  • static_assert or STATIC_ASSERT macro
  • stdex_char16_t and stdex_char32_t (as equivalent to char16_t, char32_t)
  • stdex_noexcept (as partial equivalent to noexcept)
  • stdex_assert macro (as equivalent to cassert macro)
  • move semantic is in progress

Utilities library

| name | purpose | implemented | is final | |----------------------|--------------------------------------------------------------------------------|:------------:|----------| | <typeindex> | stdex::type_index | 100% | maybe | | <type_traits> | Compile-time type information | 70% | no | | <functional> | Function objects, Function invocations, Bind operations and Reference wrappers | no | no | | <chrono> | C++ time utilities | 100% | yes | | <initializer_list> | stdex::initializer_list class template | no and never | yes | | <tuple> | stdex::tuple class template | no | no |

Dynamic memory management

| name | purpose | implemented | is final | |----------------------|------------------------|:------------:|----------| | <scoped_allocator> | Nested allocator class | no | maybe |

Numeric limits

| name | purpose | implemented | is final | |----------------------|----------------------------------------------------------------|:------------:|----------| | <cstdint> | fixed-size types and limits of other types | 99% | maybe | | <cinttypes> | formatting macros, intmax_t and uintmax_t math and conversions | no | maybe |

Error handling

| name | purpose | implemented | is final | |----------------------|------------------------------------------------------------|:------------:|----------| | <system_error> | defines stdex::error_code, a platform-dependent error code | 100% | yes |

Strings library

| name | purpose | implemented | is final | |----------------------|---------------------------------------------------------|:------------:|----------| | <cuchar> | C-style Unicode character conversion functions | no | maybe | | <string> | stdex::basic_string, stdex::stoi, stdex::to_string etc. | 50% | no |

Containers library

| name | purpose | implemented | is final | |-------------------|----------------------------------------|:-----------:|----------| | <array> | stdex::array container | no | maybe | | <forward_list> | stdex::forward_list container | no | maybe | | <unordered_set> | unordered associative set containers | no | maybe | | <unordered_map> | unordered associative map containers | no | maybe |

Iterators library

| name | purpose | implemented | is final | |-------------------|-----------------|:-----------:|----------| | <iterator> | Range iterators | 100% | yes |

Algorithms library

| name | purpose | implemented | is final | |-------------------|-----------------------------------|:-----------:|----------| | <algorithm> | Algorithms that operate on ranges | 100% | yes |

Numerics library

| name | purpose | implemented | is final | |-------------------|---------------------------------------------|:-----------:|----------| | <random> | Random number generators and distributions | no | maybe | | <ratio> | Compile-time rational arithmetic | 99% | maybe | | <cfenv> | Floating-point environment access functions | no | maybe |

Input/output library

| name | purpose | implemented | is final | |-------------------|------------------------------------------------------------------------------------------------------------------------|:-----------:|----------| | <sstream> | stdex::basic_stringstream, stdex::basic_istringstream, stdex::basic_ostringstream class templates and several typedefs | 30% | maybe |

Regular Expressions library

| name | purpose | implemented | is final | |-------------------|----------------------------------------------------------------------------|:-----------:|----------| | <regex> | Classes, algorithms and iterators to support regular expression processing | no | maybe |

Atomic Operations library

| name | purpose | implemented | is final | |-------------------|---------------------------|:-----------:|----------| | <atomic> | Atomic operations library | no | no |

Thread support library

| name | purpose | implemented | is final | |------------------------|-----------------------------------------------|:-----------:|----------| | <thread> | stdex::thread class and supporting functions | 90% | no | | <mutex> | mutual exclusion primitives | 90% | no | | <future> | primitives for asynchronous computations | no | maybe | | <condition_variable> | thread waiting conditions | 100% | yes |

</details>

Not all features of C++ 11 can be implemented without compiler support so I have no plans to include such features in the library.

The library is portable for any compiler that supports C++98 but as we all know there are lots of different implementations of std library in even major compilers so this library is tested with:

  • Borland C++ Builder 6.0 Updt4;
  • qcc (just a wrapper over gcc in QNX)
  • g++ 3.4, 4.4.2, 4.4, 4.6;
  • g++ 4.8, 4.9, 5.0 with c++98 option;
  • clang 3.5, 5.0 with c++98 option;
  • clang-900.0.37 with c++98 option (Mac OS);
  • Visual Studio 2008, 2010, 2013, 2015, 2017;

...and that's it. If you use other compilers and decide to include this library in your project there is no guarantee that it will compile without errors. In case you will be able to fix the errors without breaking existing code for already supported compilers I would really appreciate your pull requests.

For the C++ threads (mutexes, threads) I'm using

View on GitHub
GitHub Stars67
CategoryDevelopment
Updated1y ago
Forks7

Languages

C++

Security Score

85/100

Audited on Nov 1, 2024

No findings