C++ links: Coroutines
https://github.com/MattPD/cpplinks / C++ Standard / C++20 / Coroutines
(draft; work in progress)
#coroutines (C++ Slack): https://cpplang.slack.com/archives/C5JS5JXT5
| ############################################# | |
| # ----------- | |
| # Import from conan only. | |
| # ----------- | |
| conan_pkgs= { | |
| 'fmt':'fmt/5.3.0@', # <- Must contain @, otherwise Conan will think it is a path | |
| # ... the dependency list goes on | |
| } | |
| # Adding new dependencies to this dict is error-free, but if you |
| CFLAGS = -std=c99 -Wall | |
| main : main.o | |
| .PHONY : test clean | |
| test : main | |
| ./$^ "*regex*" "*vtable*" < main.c | |
| clean : |
| # Cleanup old alternatives | |
| update-alternatives --remove-all cc | |
| update-alternatives --remove-all c++ | |
| update-alternatives --remove-all gcc | |
| update-alternatives --remove-all g++ | |
| update-alternatives --remove-all clang | |
| update-alternatives --remove-all clang++ | |
| update-alternatives --remove-all icc | |
| update-alternatives --remove-all icc++ |
https://github.com/MattPD/cpplinks / C++ Standard / C++20 / Coroutines
(draft; work in progress)
#coroutines (C++ Slack): https://cpplang.slack.com/archives/C5JS5JXT5
Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.
$ python -m SimpleHTTPServer 8000| /* Copyright (c) 2018 Arvid Gerstmann. */ | |
| /* This code is licensed under MIT license. */ | |
| #ifndef AG_RANDOM_H | |
| #define AG_RANDOM_H | |
| class splitmix | |
| { | |
| public: | |
| using result_type = uint32_t; | |
| static constexpr result_type (min)() { return 0; } |
| template <typename InputIt, typename OutputIt> | |
| OutputIt | |
| radix_sort_split(InputIt first, InputIt last, OutputIt output, std::uint64_t bit) | |
| { | |
| std::vector<std::uint64_t> e(std::distance(first, last)); | |
| // Count 0s. | |
| std::transform(first, last, e.begin(), | |
| [=] (auto t) { return !(t & (1 << bit)); }); |
| template <typename InputIt, typename OutputIt, typename BinaryOp, typename T, typename Size> | |
| unique_future<OutputIt> | |
| async_inclusive_scan(InputIt first, InputIt last, OutputIt output,BinaryOp op, T init, Size chunk_size) | |
| { | |
| Size const elements = std::distance(first, last); | |
| Size const chunks = (1 + ((elements - 1) / chunk_size)); // Round up. | |
| std::vector<unique_future<T>> sweep; | |
| sweep.reserve(chunks); |
| git remote prune origin | |
| git branch -r --merged master | egrep -iv '(master|develop)' | sed 's/origin\///g' | xargs -n 1 git push --delete origin |
| #!/usr/bin/env bash | |
| # | |
| # Runs clang-format on changed regions before commit. | |
| # | |
| # To install this, copy it to .git/hooks/pre-commit in your repo. | |
| # Remaining installation checks/instructions will be printed when you commit. | |
| # | |
| read -d '' help <<- EOF | |
| This repository requires you to install the git clang-format command. |