Since it's impossible to find one concise source anywhere, as far as I can tell:
- C++98:
199711L - C++11:
201103L - C++14:
201402L - C++17:
201703L - C++20:
202002L - C++23:
202302L
| #ifndef ONE_OF_H | |
| #define ONE_OF_H | |
| #include <tuple> | |
| #include <utility> | |
| template <class... T> | |
| struct one_of { | |
| std::tuple<T...> t; | |
| constexpr one_of(T&&... values) : t{std::forward<T>(values)...} {} |
| // TODO concepts/constraints/SFINAE to keep T as FP | |
| // TODO make this more robust than the very basics | |
| template <class T> | |
| class KahanSum { | |
| public: | |
| KahanSum() : sum_{}, err_{} {} | |
| KahanSum(T init) : sum_{init}, err_{} {} | |
| constexpr KahanSum& Add(T val) { |
| /* | |
| * Basic register map implementation in C++. Makes reading/writing registers | |
| * safer, should be just as efficient as doing things the old fashioned way. | |
| * The setup is a little ugly, but such is life. It was never going to be pretty | |
| * anyway. | |
| * | |
| * Requires C++20, though that could be changed with a little SFINAE trickery. | |
| * | |
| * Example code uses GPIO peripherals on an AM3358. | |
| * |
| // in action: https://godbolt.org/z/8z8r37rGP | |
| #include <algorithm> | |
| #include <array> | |
| #include <iostream> | |
| #include <tuple> | |
| #include <utility> | |
| class L { | |
| public: |
| #ifndef THROW_ERRNO_H | |
| #define THROW_ERRNO_H | |
| #include <cerrno> | |
| #include <string> | |
| #include <system_error> | |
| [[noreturn]] | |
| inline void throw_errno() { | |
| throw std::system_error(errno, std::system_category()); |
Since it's impossible to find one concise source anywhere, as far as I can tell:
199711L201103L201402L201703L202002L202302L| #include <stdbool.h> | |
| #include <stdint.h> | |
| #include <stdio.h> | |
| #include <string.h> | |
| #define STX 0x02 | |
| #define ETX 0x03 | |
| int main(int argc, char** argv) { | |
| FILE* src = NULL; |
| #!/bin/sh | |
| set -e | |
| # For each tag in the repository (sorted in reverse chronological order), print | |
| # something like the following: | |
| # | |
| # ## Version <TAG> | |
| # <Tag body, if it has one, but not the body of the pointed-to commit> | |
| # |
| #include <stdio.h> | |
| static char a[65535] = {0}; | |
| static char* p = a; | |
| int main() { | |
| *p += 8; | |
| for (; *p;) { | |
| *++p += 4; | |
| for (; *p;) { | |
| *++p += 2; | |
| *++p += 3; |
| #include <stdio.h> | |
| #include <stdlib.h> | |
| #include <string.h> | |
| #include <stdint.h> | |
| #include <errno.h> | |
| #include <ctype.h> | |
| #include <stdbool.h> | |
| #define SWAP(a,b) ((a)^=(b),(b)^=(a),(a)^=(b)) |