The question is pretty much in the title. According to C++ Reference, std::endl
is actually a function. Looking at its declaration in <iostream>
, this can be verified.
However, when you use std::endl
, you don't use std::endl()
. Instead, you use:
std::cout << "Foo" << std::endl;
In fact, if you use std::endl()
, the compiler demands more parameters, as noted on the link above.
Would someone care to explain this? What is so special about std::endl
? Can we implement functions that do not require any brackets when calling too?