Modern C++ Tutorial: C++11/14/17/20 On the Fly
Modern C++ Tutorial: C++11/14/17/20 On the Fly Changkun Ou (hi[at]changkun.de) Last update: May 7, 2023 Notice The content in this PDF file may outdated, please check our website or GitHub repository also use this book to review and examine themselves on modern C++. Purpose The book claims “On the Fly”. It intends to provide a comprehensive introduction to the relevant features regarding modern C++0 码力 | 92 页 | 1.79 MB | 1 年前3Compile-Time Validation
class action { jump, fly }; void on_action(action user_action) { switch(user_action) { case action::jump: jump(); break; case action::fly: fly(); break; } }Example - action { jump, fly, swim }; void on_action(action user_action) { switch(user_action) { case action::jump: jump(); break; case action::fly: fly(); break; // // forgot to handle action::swim } }Example - Enum enum class action { jump, fly }; void on_action(action user_action) { static_assert(magic_enum::enum_count() == 2); switch(user_action){ 0 码力 | 137 页 | 1.70 MB | 5 月前3Back to Basics: Lambdas
Tcommunication Lambdas 。Lambda: Function defined on the fly [output [oaa slens: 6 和rst cdd elem: 15 stdi :vectorcoll{0,8,15,42,11,1,77,-1,3)1 Jecount = std::find_if(coll.begin() ,coll.end() , jlrange (int elem) 1 Jicriterion (defined on the fly) return elem 8 2 让 if (pos != coll.end()) use positionifany atd: :cout << "first Cr+ Lambdas Lambdas *。Lambda: Function object defined on the fly [out oaa elems: 6 和rst odd elem: 15 stdi :vector coll{0,8,15,42,11,1,77,-1,3)1 auto isodd 0 码力 | 17 页 | 935.72 KB | 5 月前3Rust 程序设计语言简体中文版
Pilot 和 Wizard 都拥有方法 fly 。接着在一个本身已经实现了名 为 fly 方法的类型 Human 上实现这两个 trait。每一个 fly 方法都进行了不同的操作: 文件名:src/main.rs trait Pilot { fn fly(&self); } trait Wizard { fn fly(&self); } struct Human; 简体中文版 fn fly(&self) { println!("This is your captain speaking."); } } impl Wizard for Human { fn fly(&self) { println!("Up!"); } } impl Human { fn fly(&self) { 示例 19-16: 两个 trait 定义为拥有 fly 方法,并在直接定义有 fly 方法的 Human 类型上实现 这两个 trait 当调用 Human 实例的 fly 时,编译器默认调用直接实现在类型上的方法,如示例 19-17 所 示。 文件名:src/main.rs # trait Pilot { # fn fly(&self); # } # # trait Wizard0 码力 | 600 页 | 12.99 MB | 1 年前3亚马逊AWSAI Services Overview
to fly?” “When would you like to fly?” Polly Origin Destination Departure Date Flight Booking London Heathrow Seattle Prompt “When would you like to fly?” “When would you like to fly?”0 码力 | 56 页 | 4.97 MB | 1 年前3CakePHP Cookbook 2.x
your system path Creating a shell Using Models in your shells Shell tasks Loading tasks on the fly with TaskCollection Invoking other shells from your shell Console output levels Styling output Turning can respond with a file that does not exist on the disk, such as a pdf or an ics generated on the fly from a string: public function sendIcs() { $icsString = $this->Calendar->generateIcs(); $t ‘namespace’. Be sure to not give a component and a model the same name. Loading components on the fly You might not need all of your components available on every controller action. In situations like0 码力 | 1096 页 | 958.62 KB | 1 年前3The TypeScript Handbook
example a human could both swim and fly (with the right equipment) and thus should show up in both sides of the in check: type Fish = { swim: () => void }; type Bird = { fly: () => void }; function move(animal: move(animal: Fish | Bird) { if ("swim" in animal) { return animal.swim(); } return animal.fly(); } instanceof narrowing JavaScript has an operator for checking whether or not a value is an "instance" guarded by instanceof s. type Fish = { swim: () => void }; type Bird = { fly: () => void }; type Human = { swim?: () => void; fly?: () => void }; function move(animal: Fish | Bird | Human) { if ("swim"0 码力 | 184 页 | 647.99 KB | 1 年前3Krita 5.2 Manual
that change a lot. Fill Layers These layers are filled with something that Krita can make up on the fly, like colors or patterns. Filter Layer These layers help us to apply some filters which will affect the whole group – including doing selection on the group and cut all the sub layers inside on the fly. You can not apply filters to group to affect multiple layers. Clipping Masks Krita has no clipping easy shadow layers. In fact, with the filter layers and layer masks you can make them apply on the fly as you draw underneath. Pop-up palette This is the little circular thing that is by default on the0 码力 | 1502 页 | 79.07 MB | 1 年前3CakePHP Cookbook 2.x
can respond with a file that does not exist on the disk, such as a pdf or an ics generated on the fly from a string: public function sendIcs() { $icsString = $this->Calendar->generateIcs(); $this->r ‘namespace’. Be sure to not give a component and a model the same name. Loading components on the fly You might not need all of your components available on every controller action. In situations like $this->Components->load('OneTimer'); $this->OneTimer->getTime(); Note: Keep in mind that loading a component on the fly will not call its initialize method. If the component you are calling has this method you will need0 码力 | 820 页 | 2.52 MB | 1 年前3Buzzing Across Space
had a flash; they’d no longer get bored! “You are small enough”, he said to their spokesbee, “To fly straight to the engine room and work from the inside.” “Would you like to assist?” “Of course”, answered quantic guidance units? New versions all had a completely different shape. eBee’s friends couldn’t fly between the narrower bits. Had the engine-hacking adventure met its fate? “Not a chance” said eBee build a brand new scanner, To map all areas and paths in the engine room, So the bees were able to fly again, faster Kernel types and data structures are in constant flux. eBPF "Compile Once — Run Everywhere"0 码力 | 32 页 | 32.98 MB | 1 年前3
共 1000 条
- 1
- 2
- 3
- 4
- 5
- 6
- 100