File tree Expand file tree Collapse file tree 5 files changed +64
-0
lines changed
Expand file tree Collapse file tree 5 files changed +64
-0
lines changed Original file line number Diff line number Diff line change 1+ # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
2+
3+ FROM mcr.microsoft.com/devcontainers/cpp:1-ubuntu-22.04
4+
5+ USER vscode
6+
7+ # Install latest cmake
8+ RUN wget -O - https://apt.kitware.com/keys/kitware-archive-latest.asc 2>/dev/null | gpg --dearmor - | sudo tee /usr/share/keyrings/kitware-archive-keyring.gpg >/dev/null
9+ RUN echo 'deb [signed-by=/usr/share/keyrings/kitware-archive-keyring.gpg] https://apt.kitware.com/ubuntu/ jammy main' | sudo tee /etc/apt/sources.list.d/kitware.list >/dev/null
10+ RUN sudo apt-get update && sudo apt-get install -y cmake
11+
12+ # Install pre-commit
13+ RUN sudo apt-get install -y python3-pip && pip3 install pre-commit
14+
15+ # Avoid ASAN Stalling
16+ # Alternative is to update to clang-18 and gcc-13.2
17+
18+ RUN sudo sysctl -w vm.mmap_rnd_bits=28
Original file line number Diff line number Diff line change 1+ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
2+ // For format details, see https://aka.ms/devcontainer.json. For config options, see the
3+ // README at: https://github.com/devcontainers/templates/tree/main/src/cpp
4+
5+ {
6+ "name" : " Beman Project Generic Devcontainer" ,
7+ "build" : {
8+ "dockerfile" : " Dockerfile"
9+ },
10+ "postCreateCommand" : " bash .devcontainer/postcreate.sh" ,
11+ "customizations" : {
12+ "vscode" : {
13+ "extensions" : [
14+ " ms-vscode.cpptools" ,
15+ " ms-vscode.cmake-tools"
16+ ]
17+ }
18+ }
19+ }
Original file line number Diff line number Diff line change 1+ # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
2+ # Setup pre-commit
3+ pre-commit
4+ pre-commit install
Original file line number Diff line number Diff line change 66list(
77 APPEND
88 EXAMPLES
9+ playground
910 sender-demo
1011 when_all-cancel
1112 stop_token
Original file line number Diff line number Diff line change 1+ // examples/playground.cpp -*-C++-*-
2+ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
3+
4+ #include < beman/execution26/execution.hpp>
5+ #include < iostream>
6+ #include < string>
7+ #include < tuple>
8+
9+ namespace ex = ::beman::execution26;
10+
11+ // ----------------------------------------------------------------------------
12+
13+ int main ()
14+ {
15+ auto [result] = ex::sync_wait (
16+ ex::when_all (
17+ ex::just (std::string (" hello, " )),
18+ ex::just (std::string (" world" ))
19+ ) | ex::then ([](auto s1, auto s2){ return s1 + s2; })
20+ ).value_or (std::tuple (std::string (" oops" )));
21+ std::cout << " result='" << result << " '\n " ;
22+ }
You can’t perform that action at this time.
0 commit comments