News for hackers. Stuff that matters.
Re:C++: Uniquely addressed by hun-nemethpeter on Sunday May 31, 2015 @01:38PM (#9634854)
In the first example sum_f() was declared with two parameter but used with zero param.
Re:C++: Uniquely addressed by vmarsy on Sunday May 31, 2015 @01:53PM (#9634898)
No, sum_f is a functor, only its operator() is overloaded to receive 2 parameters, the constructor of the struct is a default constructor that takes no argument.

http://www.cprogramming.com/tutorial/functors-function-objec...

Re:C++: Uniquely addressed by hun-nemethpeter on Sunday May 31, 2015 @04:37PM (#9635444)
Oops.. Yes, you are right.
Re:C++: Uniquely addressed by pfultz2 on Sunday May 31, 2015 @02:53PM (#9635121)
`sum_f()` is calling the constructor, not the call operator(which would be `sum_f()(1, 2)`).