Initial Boost.Function commit

[SVN r10372]
This commit is contained in:
Beman Dawes
2001-06-21 17:01:43 +00:00
parent 62db26b94d
commit 322df8287e
10 changed files with 1672 additions and 0 deletions

32
test/policy_test.cpp Normal file
View File

@ -0,0 +1,32 @@
#define BOOST_INCLUDE_MAIN
#include <boost/test/test_tools.hpp>
#include <cassert>
#include <iostream>
#include <functional>
#include <boost/function.hpp>
using namespace std;
using namespace boost;
struct counting_policy
{
static int count;
void precall(function_base*) { count++; }
void postcall(function_base*) { count+=2; }
};
int counting_policy::count = 0;
int
test_main(int, char*[])
{
function<int, int, int>::policy<counting_policy>::type f;
f = plus<int>();
BOOST_TEST(5 == f(2,3));
BOOST_TEST(counting_policy::count==3);
return 0;
}