[ create a new paste ] login | about

Link: http://codepad.org/WAU3yRgH    [ raw code | output | fork ]

uskz - C++, pasted on Feb 12:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#include <iostream>
#include <boost/function.hpp>
#include <boost/lambda/lambda.hpp>

int main()
{
  namespace bst = boost;
  namespace bll = bst::lambda;

  int c = 0;
  bst::function<void()> f = bll::var(c)++;
  f();
  std::cout << c << std::endl;
  f();
  std::cout << c << std::endl;
  f();
  std::cout << c << std::endl;
}


Output:
1
2
3
1
2
3


Create a new paste based on this one


Comments: