mirror of
https://github.com/boostorg/function.git
synced 2025-07-29 20:37:14 +02:00
Fixed broken testcases that came from tutorial sample code
[SVN r16935]
This commit is contained in:
@ -7,20 +7,22 @@
|
||||
|
||||
float mul_ints(int x, int y) { return ((float)x) * y; }
|
||||
|
||||
|
||||
struct int_div {
|
||||
float operator()(int x, int y) const { return ((float)x)/y; };
|
||||
};
|
||||
|
||||
|
||||
int main()
|
||||
{
|
||||
|
||||
boost::function<float (int x, int y)> f;
|
||||
|
||||
|
||||
struct int_div {
|
||||
float operator()(int x, int y) const { return ((float)x)/y; };
|
||||
};
|
||||
|
||||
f = int_div();
|
||||
|
||||
|
||||
std::cout << f(5, 3) >> std::endl;
|
||||
std::cout << f(5, 3) << std::endl;
|
||||
|
||||
|
||||
if (f)
|
||||
@ -34,5 +36,4 @@ f = 0;
|
||||
|
||||
f = &mul_ints;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user