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
# This was created by cxx_modules_builder. DO NOT EDIT. | |
MAKE_NINJA = /home/mstearn/opensource/cxx_modules_builder/modules_builder.py | |
CXX = /usr/sbin/clang++ | |
# START HEADER | |
COMMONFLAGS = -stdlib=libc++ -pthread | |
DEBUGFLAGS = -ggdb3 -gsplit-dwarf | |
CXXFLAGS = -fcolor-diagnostics -fPIC -Isrc -Ibuild/src -Isrc/external/pegtl/include/tao/ -std=c++2a -DREALM_DEBUG=1 $COMMONFLAGS $DEBUGFLAGS | |
LIBS = -lcrypto -lc++experimental | |
LINKFLAGS = -fuse-ld=lld $COMMONFLAGS |
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
#pragma once | |
#include <iterator> | |
#include <utility> | |
#include <coroutine> | |
// Only need one of these. Shouldn't depend on generator's T. | |
struct generator_sentinel {}; | |
template <typename T> |
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
-------------------------------- MODULE OT -------------------------------- | |
EXTENDS Integers, TLC, FiniteSets, Sequences | |
CONSTANTS i_set, i_inc, i_nop \* Instruction model values | |
CONSTANT NULL | |
CONSTANT ImprovedAlgo | |
ASSUME ImprovedAlgo \in BOOLEAN |
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
export module quux; | |
export struct quux{}; | |
/////////// | |
// bar.h | |
import quux | |
///////// |
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
clang++ -std=c++2a -x c++-module iface.cpp --precompile -o iface.pcm -stdlib=libc++ | |
clang++ -std=c++2a -x c++ consumer.cpp -c -o consumer.o -fmodule-file=iface.pcm -stdlib=libc++ | |
echo <<OUTPUT | |
In file included from consumer.cpp:2: | |
In file included from /usr/include/c++/v1/string:505: | |
In file included from /usr/include/c++/v1/string_view:176: | |
In file included from /usr/include/c++/v1/__string:57: | |
In file included from /usr/include/c++/v1/algorithm:643: | |
/usr/include/c++/v1/utility:574:1: error: redeclaration of deduction guide |
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
// {{{ | |
// vim: set foldmethod=marker: | |
// g++ -O3 -pthread sc.cpp && ./a.out | |
#include <cstdio> | |
#include <thread> | |
#include <atomic> | |
using namespace std; | |
constexpr auto load_order = memory_order_acquire; | |
constexpr auto store_order = memory_order_release; |
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
(depth 1 are direct includes from the cpp) | |
A single file from our codebase: | |
28 headers at depth 1 | |
35 headers at depth 2 | |
50 headers at depth 3 | |
74 headers at depth 4 | |
82 headers at depth 5 | |
89 headers at depth 6 | |
127 headers at depth 7 |
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 possible implementation of symmetic coroutines on top of the asymmetric coroutines ts. | |
// At the bottom of this file, I've rewritten the symmetric examples from Boot.Coroutine | |
// using this mechanism. You can see the originals at | |
// https://www.boost.org/doc/libs/1_69_0/libs/coroutine/doc/html/coroutine/coroutine/symmetric.html | |
#include <experimental/coroutine> | |
#include <cassert> | |
#include <list> | |
#include <optional> | |
#include <vector> |
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
template <typename T> | |
struct semi_lazy { | |
struct promise_type { | |
std::optional<T> val; | |
std::function<void()> defer; | |
suspend_never initial_suspend() { return {}; } | |
suspend_always final_suspend() { return {}; } | |
void return_value(T v) { | |
val.emplace(std::move(v)); |
NewerOlder