init
Some checks failed
Docker. / Ubuntu (push) Has been cancelled
User-agent updater. / User-agent (push) Failing after 15s
Lock Threads / lock (push) Failing after 10s
Waiting for answer. / waiting-for-answer (push) Failing after 22s
Needs user action. / needs-user-action (push) Failing after 8s
Can't reproduce. / cant-reproduce (push) Failing after 8s
Close stale issues and PRs / stale (push) Has been cancelled
Some checks failed
Docker. / Ubuntu (push) Has been cancelled
User-agent updater. / User-agent (push) Failing after 15s
Lock Threads / lock (push) Failing after 10s
Waiting for answer. / waiting-for-answer (push) Failing after 22s
Needs user action. / needs-user-action (push) Failing after 8s
Can't reproduce. / cant-reproduce (push) Failing after 8s
Close stale issues and PRs / stale (push) Has been cancelled
This commit is contained in:
18
Telegram/ThirdParty/range-v3/example/view/transform.cpp
vendored
Normal file
18
Telegram/ThirdParty/range-v3/example/view/transform.cpp
vendored
Normal file
@@ -0,0 +1,18 @@
|
||||
//! [transform example]
|
||||
#include <iostream>
|
||||
#include <vector>
|
||||
#include <range/v3/view/transform.hpp>
|
||||
|
||||
int main()
|
||||
{
|
||||
std::vector<int> numbers{1, 2, 3};
|
||||
|
||||
auto halved = numbers
|
||||
// Divide each integer by 2, converting it into a double
|
||||
| ranges::views::transform([](const int& num) {
|
||||
return num / 2.0;
|
||||
});
|
||||
|
||||
std::cout << halved << '\n';
|
||||
}
|
||||
//! [transform example]
|
||||
Reference in New Issue
Block a user