Working with Asynchrony Generically: A Tour of C++ ExecutorsC++20 coroutines5 Example 1: Launching concurrent work6 EXAMPLE: LAUNCHING CONCURRENT WORK namespace ex = std::execution; int compute_intensive(int); int main() { unifex::static_thread_pool pool{8}; libunifex: https://github.com/facebookexperimental/libunifex7 EXAMPLE: LAUNCHING CONCURRENT WORK namespace ex = std::execution; int compute_intensive(int); int main() { unifex::static_thread_pool pool{8}; algorithms, among others.8 EXAMPLE: LAUNCHING CONCURRENT WORK Use pipe syntax if you want to. namespace ex = std::execution; int compute_intensive(int); int main() { unifex::static_thread_pool pool{8};0 码力 | 121 页 | 7.73 MB | 6 月前3
Secure your microservices with istio step by step2) Deploy bookinfo gateway 3) Deploy reviews-v2 service without istio sidecar ( kubectl label namespace default istio-injection=disabled/enabled ) Initializing services 1) Deploy bookinfo services 2) Deploy bookinfo gateway 3) Deploy reviews-v2 service without istio sidecar ( kubectl label namespace default istio-injection=disabled/enabled ) http http http http http http http Result: can server #IstioCon Istio identity – how to get configuration ● Format: "spiffe:///ns/<namespace>/sa/ ” ● istioctl proxy-config secret -o json | jq '.dynamicActiveSecrets[0] 0 码力 | 34 页 | 67.93 MB | 1 年前3
C++20's • …11 Some examples: Simple Calendrical Types #include#include using namespace std::chrono; int main() { year y{2021}; std::cout << y << "\n"; month m{October}; Some examples: Simple Calendrical Types (continued) #include #include using namespace std::chrono; int main() { weekday wd{Thursday}; auto result = wd + days{4}; std::cout Thu[4]13 Some examples: Compound Calendrical Types #include #include using namespace std::chrono; int main() { year this_year{2021}; year last_year{2020}; year_month_day 0 码力 | 55 页 | 8.67 MB | 6 月前3
C++20 STL Features: 1 Year of Development on GitHubFeatures Part 17 Comparing Integers8 Usual Arithmetic Conversions #includeusing namespace std; int main() { cout << boolalpha; short s = -1; unsigned int ui = 1729; Comparison Functions • GH-621 implemented by Neargye #include #include using namespace std; int main() { cout << boolalpha; short s = -1; unsigned int ui = 1729; #include #include #include #include using namespace std; int main() { static constexpr array skipped_extensions{".dll"sv, ".exe"sv, ".obj"sv}; 0 码力 | 45 页 | 702.09 KB | 6 月前3
A Crash Course in Calendars, Dates, Time, and Time ZonesRequire any of the following using directives: using namespace std; using namespace std::literals; using namespace std::chrono_literals; using namespace std::literals::chrono_literals;17 Durations – Predefined0 码力 | 43 页 | 551.60 KB | 6 月前3
C++高性能并行编程与优化 - 课件 - 15 C++ 系列课:字符与字符串新特性:自定义字面量后缀 • 如果你 using namespace std; 其实标准库已经自动帮你定义好了 “” s 后缀。 • 这里 “ hello”s 就等价于原本繁琐的 string(“hello”) 了。 C++14 新特性:自定义字面量后缀 • 如果你觉得 using namespace std; 太危险了不想用他。 • 可以只用 using namespace std::literials; • std::string ,“ hello”s 是 std::string_view 。 • 我也可以定义一个 “ hello”ms 是 mylib::String ,而且还是受 namespace 限制的,用户可以 自己 using namespace ,不会存在强迫别人接受你的那一套后缀名规范。 • 甚至可以自定义一个 class int32 具有成员函数,然后就可以快乐地 233_i32 .some_method()0 码力 | 162 页 | 40.20 MB | 1 年前3
Автоматизация управления ClickHouse-кластерами в Kubernetesname: "demo" Здесь нет storage Еще вернемся к этому kubectl – наше всё 1. NAMESPACE $ kubectl create namespace demo namespace/demo created 2. EXAMPLE $ kubectl apply -f docs/examples/demo-01.yaml -n demo0 码力 | 44 页 | 2.24 MB | 1 年前3
C++23: An Overview of Almost All New and Updated Featureseverything from std namespace from C++ headers (e.g. std::sort()) C wrapper headers (e.g. std::fopen()) import std.compat; Imports everything std imports + global namespace versions of the C contains("World")); // true std::println("{}", haystack.contains('!')); // true using namespace std::string_view_literals; std::println("{}", haystack.contains("Hello"sv)); // true54 Agenda0 码力 | 105 页 | 759.96 KB | 6 月前3
C++高性能并行编程与优化 - 课件 - 12 从计算机组成原理看 C 语言指针std::memcpy , std::size_t 虽然 这些其实没有任何区别…… using namespace std 大法的确也可以 • 顺便一提,用了 using namespace std 以后全局 的 abs 就有重载了,可以不加 std:: 前缀。 • 但是我个人很不推荐 using namespace std 因为 : • std::ws , std::tm , std::exa ,0 码力 | 128 页 | 2.95 MB | 1 年前3
C++高性能并行编程与优化 - 课件 - 16 现代 CMake 模块化项目管理指南/include/ 项目名 / 模块名 .h )中写: • #pragma once • namespace 项目名 { • void 函数名 (); • } • 实现文件(项目名 /src/ 模块名 .cpp )中写: • #include < 项目名 / 模块名 .h> • namespace 项目名 { • void 函数名 () { 函数实现 } • } 完整案例请看源码仓库:0 码力 | 56 页 | 6.87 MB | 1 年前3
共 12 条
- 1
- 2













