int main() // Structured binding + if init if (auto result = safe_divide(10, 2); result.has_value()) auto [val] = result; // structured binding std::cout << "Result: " << val << '\n';
// Filesystem (C++17) for (const auto& entry : fs::directory_iterator(".")) std::cout << entry.path().filename() << '\n';
std::optional<int> safe_divide(int a, int b) if (b == 0) return std::nullopt; return a / b;
Level 1
Need to earn: $0
Level 2
Need to earn: $1
Level 3
Need to earn: $2
Level 4
Need to earn: $5
Level 5
Need to earn: $7
Level 6
Need to earn: $10
Level 7
Need to earn: $33
Level 8
Need to earn: $100
Level 9
Need to earn: $500
Level 10
Need to earn: $1000
int main() // Structured binding + if init if (auto result = safe_divide(10, 2); result.has_value()) auto [val] = result; // structured binding std::cout << "Result: " << val << '\n';
// Filesystem (C++17) for (const auto& entry : fs::directory_iterator(".")) std::cout << entry.path().filename() << '\n'; vc++ 2017
std::optional<int> safe_divide(int a, int b) if (b == 0) return std::nullopt; return a / b; int main() // Structured binding + if init
Authorization required to get cashback
Choose your region:
Choose country
Country language
English
Русский
Deutsche
Français
Español
Português
Polski
Italiano
Ελληνικά
Türkçe
中文
🍪 We use cookies
We use cookies on our website to help us improve the site's experience. Read more