gul is an open-source library providing general utilities for c++11. Many of them are backported from later standard version.
- Header-only, no external dependencies.
- Support exceptions disabled with
-fno-exceptions
.
Utility Class | Description | From std? |
---|---|---|
byte |
A type represents the byte concept. | c++17 |
optional |
A type either holds a value of type T , or is in valueless state.Extensions:
|
c++17, 20, 23 |
expected |
A type either holds a value of type T , or an unexpected value of type E .Extensions:
|
c++23 |
integer_sequence |
A compile-time sequence of integers. | c++14 |
Utility Function | Description | From std? |
---|---|---|
exchange |
Replaces the argument with a new value and returns its previous value. | c++14, 23 |
as_const |
Obtains a reference to const to its argument. | c++17 |
cmp_equal cmp_not_equal cmp_less cmp_greater cmp_less_equal cmp_greater_equal |
Compares two integer values without value change caused by conversion. | c++20 |
to_underlying |
Converts an enumeration to its underlying type. | c++23 |
Functional | From std? |
---|---|
invoke invoke_r |
c++17 |
Memory | From std? |
---|---|
out_ptr out_ptr_t |
c++23 |
inout_ptr inout_ptr_t |
c++23 |
Container | Description | From std? |
---|---|---|
string_view wstring_view u16string_view u32string_view |
A non-owning type can refer to a constant contiguous sequence of char -like objects with the first element of the sequence at position zero.Extensions:
|
c++17, 20, 23 |
span |
A type can refer to a contiguous sequence of objects with the first element of the sequence at position zero. | c++20 |
fifo_map |
An associative container that contains key-value pairs with unique keys. Key s are sorted by insertion order. |
none |
lru_map |
An associative container that contains key-value pairs with at most capacity unique keys. The least recently used Key will be purged when the map is full during insertion. |
none |
Type Traits | From std? |
---|---|
is_null_pointer |
c++14 |
is_nothrow_convertible |
c++20 |
is_swappable_with is_swappable is_nothrow_swappable_with is_nothrow_swappable |
c++17 |
is_bounded_array |
c++20 |
is_unbounded_array |
c++20 |
is_scoped_enum |
c++23 |
is_invocable is_invocable_r |
c++17 |
is_specialization_of |
none |
conjunction conjunction_t |
c++17 |
disjunction disjunction_t |
c++17 |
negation negation_t |
c++17 |
invoke_result invoke_result_t |
c++17 |
void_t |
c++17 |
remove_cvref remove_cvref_t |
c++20 |
type_identity type_identity_t |
c++20 |
function_traits |
none |
Requirements
- CMake 3.15 (or later)
- GCC 4.8 (or later)
- Clang 3.5 (or later)
- MSVC 2015 v140 (or later)
- Apple Clang 12 (or later)
CMake
add_executable(name)
target_link_libraries(name PRIVATE gul)
gul is header-only. Just #include
the header file all.hpp
to utilize all features.
#include <gul/all.hpp>
CMake
Option | Description | Value | Default |
---|---|---|---|
GUL_BUILD_TESTS | Build tests | ON/OFF | OFF |
GUL_ENABLE_CODECOV | Enable code coverage build | ON/OFF | OFF |
cd gul/
cmake -B build -DGUL_BUILD_TESTS=ON
cmake --build build
cd build && ctest && cd ..
This project is distributed under the Boost Software License 1.0.