What does a double parenthesis in a function call do?

c++, syntax

Solution

What does `solution.probability(D)` return. If it's a functional object, or a pointer to a function, you can call it, which is probably what the second set of parentheses do.

Problem

I'm using dlib. I came across the following in one of the example programs: ` cout << "p(D=0) = " << solution.probability(D)(0) << endl;` I've never seen a double parenthesis after a function call in C++. What does it do and how does it work?

Original source

Related problems