Skip to content
U
uByte
Tutorials
🐹
Go
Beginner-friendly
🐍
Python
Clean & readable
🟨
JavaScript
Web & Node.js
☕
Java
Enterprise & OOP
🦀
Rust
Systems programming
⚙️
C++
Performance & control
💜
C#
.NET & game dev
Interview Prep
🎯
All problems
Browse every language
🐹
Go
🐍
Python
🟨
JavaScript
☕
Java
🦀
Rust
⚙️
C++
💜
C#
💬
Interview experiences
Real stories shared anonymously
Certifications
📝
Certifications
Coding exams by language
🐹
Go
🐍
Python
🟨
JavaScript
☕
Java
🦀
Rust
⚙️
C++
💜
C#
U
uByte
U
uByte
Modern C++
Instructions
Discuss
Code
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#include <iostream> #include <vector> #include <string> using namespace std; string buildLargeString() { string s = "Hello, C++ World! "; for (int i = 0; i < 3; i++) s += s; // grow it return s; // Return Value Optimization (RVO) kicks in } int main() { vector<int> original = {1, 2, 3, 4, 5}; cout << "Original size: " << original.size() << endl; vector<int> moved = move(original); // O(1) move! cout << "Moved size: " << moved.size() << endl; cout << "Original after move: " << original.size() << endl; // 0! // String move: string s1 = buildLargeString(); cout << "s1 length: " << s1.length() << endl; string s2 = move(s1); // s2 takes ownership, s1 becomes empty cout << "s1 after move: '" << s1 << "'" << endl; return 0; }
Go
Python
C++
JavaScript
Java
Rust
C#
▶ Run
✓ Check
↺ Reset starter
Share
Output
Click Run to execute, or Check to validate.
💬 Community
✨ Ask AI
Discussion
Sign in
to join the discussion.