Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
function returning a function demo
//clang 3.8.0 // function returning a function demo #include <iostream> auto powTo(int n) { return [=](double& x){const double y = x; for(int i=1; i<n; i++) x*=y;}; } int main() { double x = 1.99999999999997; int p = 16; std::cout<<x<<"**"<<p<<" = "; powTo(p)(x); std::cout<<x<<std::endl; return 0; }
run
|
edit
|
history
|
help
0
general
12/2
Graphs Iteration2 Directed Graphs
back_inserter example
10 naturalnumbers
hw1 Os
What's the problem with this?
Array-Based Heap Example Solution
Zadanie Dejwu
Peregruzka