Lambda expressions

#include <iostream>
#include "math.h"
//#include <functional>
using namespace std;

//only explicitly specify return type
function<int(int)> powOfTwo = [](int power) {
    return (int)pow(2, power);
};

int pow8 = powOfTwo(8);
//pow8 is 256

auto powOfThree = [](double power) {
    return pow(3, power);
};

double pow3 = powOfThree(3);
//pow3 is 27.0

cout << "pow8 is " << pow8 << endl;
cout << "pow3 is " << pow3;