This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#ifndef UT_TRACED_ERROR_HPP | |
#define UT_TRACED_ERROR_HPP | |
/** | |
* An exception type which automatically stores a standard stacktrace | |
* | |
* Usage: | |
* On gcc and clang, linking against libstdc++exp (-lstdc++exp) is required and compiling with -g -Og and | |
* linking with -lg is advised. | |
* | |
* `throw`ing an instance of `TracedError` (or types derived from it) will capture the stack trace. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#ifndef UT_BREAKPOINT_HPP | |
#define UT_BREAKPOINT_HPP | |
#ifndef __has_builtin | |
# define UT_DETAIL_HAS_BUILTIN(x) 0 | |
#else | |
# define UT_DETAIL_HAS_BUILTIN(x) __has_builtin(x) | |
#endif | |
#if defined(__GNUC__) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#ifndef UT_ERR | |
#define UT_ERR | |
#include <concepts> | |
#include <type_traits> | |
#if __cplusplus < 202'302L | |
# error this file has to be compiled with at least C++23 | |
#endif | |
#include <expected> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#ifndef UT_OVERLOAD | |
#define UT_OVERLOAD | |
#if __cplusplus < 201'703L | |
# error this file has to be compiled with at least C++17 | |
#endif | |
namespace ut { | |
/** |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#ifndef UT_ASIS | |
#define UT_ASIS | |
#include <memory> | |
#include <type_traits> | |
#if __cplusplus < 202'002L | |
# error this file has to be compiled with at least C++20 | |
#endif | |
namespace ut { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//! A very basic utility to manage date and time in UTC timezone. | |
//! | |
//! Usage: | |
//! | |
//! ```zig | |
//! // The following examples assume that the current date and time is 25th May 1977, at 08:48 PM | |
//! const now = DateTime.now(); | |
//! std.debug.print("{}\n", .{now}); // 1977-05-25 20:48:00 | |
//! std.debug.print("{%d %B %Y at %I}:{%M %p}\n", .{ now, now }); // 25 May 1977 at 08:48 PM | |
//! // NOTE: the format string has to be split in two, because `:` is a special character in fmt |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#ifndef UT_CHECK_HPP | |
#define UT_CHECK_HPP | |
#if __cplusplus < 201'103L | |
# error this file has to be compiled with at least C++11 | |
#endif | |
/// Class for checking when a c++ object is constructed, copied, moved from or destructed | |
/* Usage: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#ifndef UT_CONSTEXPR_HASH_HPP | |
#define UT_CONSTEXPR_HASH_HPP | |
#include <string_view> | |
#if __cplusplus < 201'703L | |
# error this file has to be compiled with at least C++17 | |
#endif | |
/* Usage: | |
* |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#ifndef UT_ADD_NOEXCEPT_H | |
#define UT_ADD_NOEXCEPT_H | |
#if __cplusplus < 201'703L | |
# error this file has to be compiled with at least C++17 | |
#endif | |
namespace ut { | |
/* | |
* Add noexcept to function type |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#ifndef UT_CHANGE_OBSERVER | |
#define UT_CHANGE_OBSERVER | |
#if __cplusplus < 202'002L | |
# error this file has to be compiled with at least C++20 | |
#endif | |
#include <functional> | |
#include <type_traits> | |
#include <vector> |
NewerOlder