Created
February 26, 2025 21:53
-
-
Save Zaryob/f5b5ff02f348938125f3e4b634161108 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <future> | |
#include <coroutine> | |
std::future<void> asyncPrint(int value) { | |
std::cout << "İşleniyor: " << value << std::endl; | |
co_await std::suspend_always{}; | |
std::cout << "Tamamlandı: " << value << std::endl; | |
} | |
int main() { | |
auto result = asyncPrint(42); | |
result.wait(); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment