 Sender Patterns to Wrangle Concurrency in Embedded Devicesa2); 7 8 int var = 0; 9 10 11 | async::then<"before-wa-then">([](auto v){ things::var = v; }) 12 | async::seq(w) 13 | async::then<"last-then">([](auto ...){ ++things::var; }) 14 | a2); 7 8 int var = 0; 9 10 11 | async::then<"before-wa-then">([](auto v){ things::var = v; }) 12 | async::seq(w) 13 | async::then<"last-then">([](auto ...){ ++things::var; }) 14 | ings::s); 19 20 while(true) {} 21 } 22 | async::then<"before-wa-then">([](auto v){ things::var = v; }) namespace things { 1 int av = 0; 2 3 auto a0 = async::just<"just-a0">(0); 4 auto a1 =0 码力 | 106 页 | 26.36 MB | 6 月前3 Sender Patterns to Wrangle Concurrency in Embedded Devicesa2); 7 8 int var = 0; 9 10 11 | async::then<"before-wa-then">([](auto v){ things::var = v; }) 12 | async::seq(w) 13 | async::then<"last-then">([](auto ...){ ++things::var; }) 14 | a2); 7 8 int var = 0; 9 10 11 | async::then<"before-wa-then">([](auto v){ things::var = v; }) 12 | async::seq(w) 13 | async::then<"last-then">([](auto ...){ ++things::var; }) 14 | ings::s); 19 20 while(true) {} 21 } 22 | async::then<"before-wa-then">([](auto v){ things::var = v; }) namespace things { 1 int av = 0; 2 3 auto a0 = async::just<"just-a0">(0); 4 auto a1 =0 码力 | 106 页 | 26.36 MB | 6 月前3
 Finding Bugs using Path-Sensitive Static Analysisbool cond) { int var = 0; // branch 1 if (p != nullptr) { var = 1; } // branch 2 if (cond) { var = 2; p = nullptr; } // branch 3 if (var == 1) { *p = 42; bool cond) { int var = 0; // branch 1 if (p != nullptr) { var = 1; } // branch 2 if (cond) { var = 2; p = nullptr; } // branch 3 if (var == 1) { *p = 42; cond) { int var = 0; // branch 1 if (p != nullptr) { var = 1; } else {} // branch 2 if (cond) { var = 2; p = nullptr; } // branch 3 if (var == 1) { *p0 码力 | 35 页 | 14.13 MB | 6 月前3 Finding Bugs using Path-Sensitive Static Analysisbool cond) { int var = 0; // branch 1 if (p != nullptr) { var = 1; } // branch 2 if (cond) { var = 2; p = nullptr; } // branch 3 if (var == 1) { *p = 42; bool cond) { int var = 0; // branch 1 if (p != nullptr) { var = 1; } // branch 2 if (cond) { var = 2; p = nullptr; } // branch 3 if (var == 1) { *p = 42; cond) { int var = 0; // branch 1 if (p != nullptr) { var = 1; } else {} // branch 2 if (cond) { var = 2; p = nullptr; } // branch 3 if (var == 1) { *p0 码力 | 35 页 | 14.13 MB | 6 月前3
 Back to Basics CastingConversionsExplicit Type Conversions a.k.a CastsC-style cast 1. Create a temporary of Back to Basics CastingConversionsExplicit Type Conversions a.k.a CastsC-style cast 1. Create a temporary of- using var 2. - can be any valid type with qualifiers 3. Overrides the type system by changing the meaning com/w/cpp/language/operator_precedence ( - )varC-style cast 1. Create a temporary of - using var 2. - can be any valid type with qualifiers 3. Overrides the type system by changing the meaning operator precedence (level 3) https://en.cppreference.com/w/cpp/language/operator_precedence ( - )var struct A{}; struct B{}; int main() { float f = 7.406f; int i = (int)f; A* pa = (A*)&f; B* pb = (B*)pa; 0 码力 | 117 页 | 1.57 MB | 6 月前3
 Data Is All You Need for Fusionfinalize(); pipeline.split(1, outer, inner, outer_step, 4); pipeline.parrallelize(1); pipeline.bind(len_var, 4); pipeline.breakPipeline(0); subpipe = pipeline.subpipeline(0, 1);Controlling Properties of the finalize(); pipeline.split(1, outer, inner, outer_step, 4); pipeline.parrallelize(1); pipeline.bind(len_var, 4); pipeline.breakPipeline(0); subpipe = pipeline.subpipeline(0, 1);Controlling Properties of the finalize(); pipeline.split(1, outer, inner, outer_step, 4); pipeline.parrallelize(1); pipeline.bind(len_var, 4); pipeline.breakPipeline(0); subpipe = pipeline.subpipeline(0, 1);Controlling Properties of the0 码力 | 151 页 | 9.90 MB | 6 月前3 Data Is All You Need for Fusionfinalize(); pipeline.split(1, outer, inner, outer_step, 4); pipeline.parrallelize(1); pipeline.bind(len_var, 4); pipeline.breakPipeline(0); subpipe = pipeline.subpipeline(0, 1);Controlling Properties of the finalize(); pipeline.split(1, outer, inner, outer_step, 4); pipeline.parrallelize(1); pipeline.bind(len_var, 4); pipeline.breakPipeline(0); subpipe = pipeline.subpipeline(0, 1);Controlling Properties of the finalize(); pipeline.split(1, outer, inner, outer_step, 4); pipeline.parrallelize(1); pipeline.bind(len_var, 4); pipeline.breakPipeline(0); subpipe = pipeline.subpipeline(0, 1);Controlling Properties of the0 码力 | 151 页 | 9.90 MB | 6 月前3
 Some Things C++ Does Rightf(g(x)); … but the calling code has to explicitly state types T, U and R: public static void Main() { var f = F_G_X Some Things C++ Does Rightf(g(x)); … but the calling code has to explicitly state types T, U and R: public static void Main() { var f = F_G_X- ( n => -n, n => n * 2 ); Console.WriteLine(f(3)); }A word about beauty and => x => f(g(x)); 60 auto f = f_g_x( [](auto x) { return –x; }, [](auto x) { return x * 2; } ); var f = F_G_X - ( n => -n, n => n * 2 );A word about beauty and elegance template - var s4 = new string(); // does not compile var s5 = new string(""); // empty stringProgramming with a value-based language 0 码力 | 228 页 | 2.47 MB | 6 月前3
 A Journey Into Non-Virtual Polymorphismusing var_def = std::variant<*DigitalPin,*AnalogPin, *SerialPort>; var_def var{&digi}; std::get<0>(var)->set(); var = &serial; std::get A Journey Into Non-Virtual Polymorphismusing var_def = std::variant<*DigitalPin,*AnalogPin, *SerialPort>; var_def var{&digi}; std::get<0>(var)->set(); var = &serial; std::get- (var)→send(); std::get - (var)→send(); 2023 | Rud Merriam | A Journey into Non-Virtual Polymorphism 17 for (auto& o: outputs) { [](var_def const& value) { switch (value.index()) { case 0: std::get type in template packCppcon 2023 | Rud Merriam | A Journey into Non-Virtual Polymorphism 18 [](var_def const& value) { if (auto res = std::get_if - (&value)) { (*res)->set(); } 0 码力 | 43 页 | 536.84 KB | 6 月前3
 Conan 2.5 Documentationpackage_folder, "bin"), keep_ ˓→path=False) def package_info(self): self.buildenv_info.define("MY_VAR", "23") There are few relevant things in this recipe: 1. It declares package_type = "application" In the package_info() method, we are using self.buildenv_info to define a environment variable MY_VAR that will also be available in the consumer. Let’s create a binary package for the tool_require: self.build_folder)) if self.settings_build.os != "Windows": self.run("echo MY_VAR=$MY_VAR") else: self.run("set MY_VAR") In this simple recipe we are declaring a tool_require to secure_scanner/1.00 码力 | 769 页 | 4.70 MB | 1 年前3 Conan 2.5 Documentationpackage_folder, "bin"), keep_ ˓→path=False) def package_info(self): self.buildenv_info.define("MY_VAR", "23") There are few relevant things in this recipe: 1. It declares package_type = "application" In the package_info() method, we are using self.buildenv_info to define a environment variable MY_VAR that will also be available in the consumer. Let’s create a binary package for the tool_require: self.build_folder)) if self.settings_build.os != "Windows": self.run("echo MY_VAR=$MY_VAR") else: self.run("set MY_VAR") In this simple recipe we are declaring a tool_require to secure_scanner/1.00 码力 | 769 页 | 4.70 MB | 1 年前3
 Conan 2.4 Documentationpackage_folder, "bin"), keep_ ˓→path=False) def package_info(self): self.buildenv_info.define("MY_VAR", "23") There are few relevant things in this recipe: 1. It declares package_type = "application" In the package_info() method, we are using self.buildenv_info to define a environment variable MY_VAR that will also be available in the consumer. Let’s create a binary package for the tool_require: self.build_folder)) if self.settings_build.os != "Windows": self.run("echo MY_VAR=$MY_VAR") else: self.run("set MY_VAR") In this simple recipe we are declaring a tool_require to secure_scanner/1.00 码力 | 769 页 | 4.69 MB | 1 年前3 Conan 2.4 Documentationpackage_folder, "bin"), keep_ ˓→path=False) def package_info(self): self.buildenv_info.define("MY_VAR", "23") There are few relevant things in this recipe: 1. It declares package_type = "application" In the package_info() method, we are using self.buildenv_info to define a environment variable MY_VAR that will also be available in the consumer. Let’s create a binary package for the tool_require: self.build_folder)) if self.settings_build.os != "Windows": self.run("echo MY_VAR=$MY_VAR") else: self.run("set MY_VAR") In this simple recipe we are declaring a tool_require to secure_scanner/1.00 码力 | 769 页 | 4.69 MB | 1 年前3
 Conan 2.10 Documentationpackage_folder, "bin"), keep_ ˓→path=False) def package_info(self): self.buildenv_info.define("MY_VAR", "23") There are few relevant things in this recipe: 1. It declares package_type = "application" In the package_info() method, we are using self.buildenv_info to define a environment variable MY_VAR that will also be available in the consumer. Let’s create a binary package for the tool_require: self.build_folder)) if self.settings_build.os != "Windows": self.run("echo MY_VAR=$MY_VAR") else: self.run("set MY_VAR") In this simple recipe we are declaring a tool_require to secure_scanner/1.00 码力 | 803 页 | 5.02 MB | 10 月前3 Conan 2.10 Documentationpackage_folder, "bin"), keep_ ˓→path=False) def package_info(self): self.buildenv_info.define("MY_VAR", "23") There are few relevant things in this recipe: 1. It declares package_type = "application" In the package_info() method, we are using self.buildenv_info to define a environment variable MY_VAR that will also be available in the consumer. Let’s create a binary package for the tool_require: self.build_folder)) if self.settings_build.os != "Windows": self.run("echo MY_VAR=$MY_VAR") else: self.run("set MY_VAR") In this simple recipe we are declaring a tool_require to secure_scanner/1.00 码力 | 803 页 | 5.02 MB | 10 月前3
 Conan 1.56 DocumentationEnvironment class MyTestPkg(ConanFile): ... def generate(self): env = Environment() env.define("foo", "var") # scope="build" is the default envvars = env.vars(self, scope="build") # This will generate a my_launcher specified in the following structure: [settings] setting=value [options] MyLib:shared=True [env] env_var=value [tool_requires] tool1/0.1@user/channel tool2/0.1@user/channel, tool3/0.1@user/channel *: tool4/0 account that the server config files are located in the home of the configured Apache user, e.g., var/www/.conan_server, so remember to use that directory to configure your Conan server. Permissions Parameters0 码力 | 963 页 | 7.67 MB | 1 年前3 Conan 1.56 DocumentationEnvironment class MyTestPkg(ConanFile): ... def generate(self): env = Environment() env.define("foo", "var") # scope="build" is the default envvars = env.vars(self, scope="build") # This will generate a my_launcher specified in the following structure: [settings] setting=value [options] MyLib:shared=True [env] env_var=value [tool_requires] tool1/0.1@user/channel tool2/0.1@user/channel, tool3/0.1@user/channel *: tool4/0 account that the server config files are located in the home of the configured Apache user, e.g., var/www/.conan_server, so remember to use that directory to configure your Conan server. Permissions Parameters0 码力 | 963 页 | 7.67 MB | 1 年前3
共 96 条
- 1
- 2
- 3
- 4
- 5
- 6
- 10













