MACRO-FREE TESTING WITH C++20std::vectorv(5); expect((5_ul == std::size(v)) >> fatal); should("resize bigger") = [v] { // section (2.1) mut(v).resize(10); expect(10_ul == std::size(v)); }; }; 5 / 14SECTIONS - SECTIONS std::vector v(5); expect((5_ul == std::size(v)) >> fatal); should("resize bigger") = [v] { // section (2.1) mut(v).resize(10); expect(10_ul == std::size(v)); }; expect((5_ul == std::size(v) fatal); should("resize bigger") = [v] { // section (2.1) mut(v).resize(10); expect(10_ul == std::size(v)); }; expect((5_ul == std::size(v) >> fatal); // (3) should("resize smaller") = [v] 0 码力 | 53 页 | 1.98 MB | 6 月前3
C++23: An Overview of Almost All New and Updated Featuresstd::generator basic_string(_view)::contains() Construct string(_view) From nullptr basic_string::resize_and_overwrite() Monadic Operations for std::optional Stacktrace Library Changes to Ranges std::generator basic_string(_view)::contains() Construct string(_view) From nullptr basic_string::resize_and_overwrite() Monadic Operations for std::optional Stacktrace Library Changes to Ranges std::generator basic_string(_view)::contains() Construct string(_view) From nullptr basic_string::resize_and_overwrite() Monadic Operations for std::optional Stacktrace Library Changes to Ranges0 码力 | 105 页 | 759.96 KB | 6 月前3
Cache-Friendly Design in Robot Path Planningvoid reset(G&& graph, VertexID s, VertexID g) 16 { 17 // Clear visited set 18 visited_.resize(graph.vertex_count()); 19 visited_.assign(graph.vertex_count(), graph.vertex_count()); 20 void reset(G&& graph, VertexID s, VertexID g) 16 { 17 // Clear visited set 18 visited_.resize(graph.vertex_count()); 19 visited_.assign(graph.vertex_count(), graph.vertex_count()); 20 while (!queue_.empty()) { queue_.pop(); } 23 // Set current goal 24 goal = g; 25 visited_.resize(graph.vertex_count()); visited_.assign(graph.vertex_count(), graph.vertex_count()); private:0 码力 | 216 页 | 10.68 MB | 6 月前3
Better Code: Exploring Validitysize() == us.size() public: PairSequence(const PairSequence &); void push_back(pair); void resize(size_t x); ~PairSequence(); PairSequence& operator=(const PairSequence&); }; Unless a function’s size() == us.size() public: PairSequence(const PairSequence &); void push_back(pair ); void resize(size_t x); ~PairSequence(); PairSequence& operator=(const PairSequence&); }; Unless a function’s size() == us.size() public: PairSequence(const PairSequence &); void push_back(pair ); void resize(size_t x); ~PairSequence(); PairSequence& operator=(const PairSequence&); }; Unless a function’s 0 码力 | 117 页 | 6.03 MB | 6 月前3
Godot Game Development for BeginnersNow we can create the text elements. Create a new Label node and call it AmmoText. • Resize and position it like in the image below • Set the Custom Font to the new dynamic font file • position to 0, 0 • Create a child node of type CollisionShape2D • Set the Shape to Capsule • Resize it to fit the sprite Right now, we're using just a sprite node to allow us to see the player sprite node 4. Set the Modulate to red 5. Create a CollisionShape2D node with a capsule shape and resize it 6. Create a Timer node - this will be used for checking for when we can attack This book0 码力 | 199 页 | 12.53 MB | 10 月前3
Oracle VM VirtualBox 4.3.36 User Manualchapter 1.11, Virtual machine configuration, page 30. 1.8.5 Resizing the machine’s window You can resize the virtual machine’s window when it is running. In that case, one of three things will happen: 1 screen is preserved when resizing the window. To ignore the aspect ratio, press Shift during the resize operation. Please see chapter 14, Known limitations, page 232 for additional remarks. 2. If you have For example, if you are running a Windows guest with a resolution of 1024x768 pixels and you then resize the VM window to make it 100 pixels wider, the Guest Additions will change the Windows display resolution0 码力 | 380 页 | 3.79 MB | 6 月前3
Oracle VM VirtualBox 4.2.32 User Manualchapter 1.11, Virtual machine configuration, page 29. 1.8.5 Resizing the machine’s window You can resize the virtual machine’s window when it is running. In that case, one of three things will happen: 1 screen is preserved when resizing the window. To ignore the aspect ratio, press Shift during the resize operation. Please see chapter 14, Known limitations, page 219 for additional remarks. 2. If you have For example, if you are running a Windows guest with a resolution of 1024x768 pixels and you then resize the VM window to make it 100 pixels wider, the Guest Additions will change the Windows display resolution0 码力 | 348 页 | 5.93 MB | 6 月前3
Leveraging a Functional Approach for More Testable and Maintainable ROS 2 Codenew_end = std::remove_if(input.begin(), input.end() , less_than_5); // input = {6, 9, 12, 9, 12} input.resize(std::distance(input.begin(), new_end)); // input = {6, 9, 12} const auto result = std::accumulate(input new_end = std::remove_if(input.begin(), input.end() , less_than_5); // input = {6, 9, 12, 9, 12} input.resize(std::distance(input.begin(), new_end)); // input = {6, 9, 12} const auto result = std::accumulate(input new_end = std::remove_if(input.begin(), input.end() , less_than_5); // input = {6, 9, 12, 9, 12} input.resize(std::distance(input.begin(), new_end)); // input = {6, 9, 12} const auto result = std::accumulate(input0 码力 | 200 页 | 1.77 MB | 6 月前3
Contracts for C++https://timur.audio // vector.h T& operator[] (size_t i); // can't put assert macro here :( void resize(size_t n); // can't put assert macro here :( P2900 pre / post can go on declarations79 Copyright can't put assert macro here :( void resize(size_t n); // can't put assert macro here :( // vector.h T& operator[] (size_t i) pre (i < size()); void resize(size_t n) post (size() == n); can't put assert macro here :( void resize(size_t n); // can't put assert macro here :( // vector.h T& operator[] (size_t i) pre (i < size()); void resize(size_t n) post (size() == n);0 码力 | 181 页 | 4.44 MB | 6 月前3
AR Game Development for Beginners3D Bottle Physics Your bottle now looks a little more refined, but its a little small. Let’s resize it by changing the Scale x, y and z properties to 1.3 respectively. Now let's create a plane properties found in the Inspector pane, by right-clicking on the Transform panel and selecting Reset. Resize it by changing the Scale x, y and z properties to 0.1 respectively. To make your bottle act as properties found in the Inspector pane, by right-clicking on the Transform panel and selecting Reset. Resize it by changing the Scale x, y and z properties to 10 respectively. Now uncheck its Mesh Renderer0 码力 | 78 页 | 3.31 MB | 10 月前3
共 98 条
- 1
- 2
- 3
- 4
- 5
- 6
- 10













