blob: 41482fdba88a9fc2737c008f75494a0a63d4bbc3 [file] [log] [blame]
// Contributed by Iain Sandoe <iain@codesourcery.com>, December 2014. */
// { dg-do compile }
// { dg-options "-std=c++11" }
template<class Function>
Function thing(Function fn, int a)
{
fn(a);
return fn;
}
int
test (int *arr, unsigned n)
{
int total = 0;
for (unsigned i=0; i<n; i++) {
int a = arr[i];
thing ([&total] (int a) { total += a; }, a);
}
return total;
}