
27 Nov
2007
27 Nov
'07
4:14 p.m.
Joseph Gauterin <joseph.gauterin <at> googlemail.com> writes:
What's the advantage to using int BOOST_LOCAL_FUNCTION(char c) { std::cout << c << '\n'; return 1; } BOOST_LOCAL_FUNCTION_DECL(a)
over:
struct { int operator()(char c)const { std::cout << c << '\n'; return 1; } } a;
Local struct can't be passed to templates: boost::function<int(char)> f = a; error: conversion from `main()::<anonymous struct>' to non-scalar type `boost::function<int ()(char), std::allocator<void> >' requested -- Alexander