You cannot take address of most standard functions (see can-i-take-the-address-of-a-function-defined-in-standard-library).
Fortunately, io-manipulator is part of the exception (See Addressable_functions).
std::endl is a template function, so you would have to select the correct overload.
using print_manip_t = std::ostream& (*) (std::ostream&); print(1, 2, 3, print_manip_t{std::endl}); print(1, 2, 3, static_cast<print_manip_t>(std::endl)); print(1, 2, 3, static_cast<std::ostream& (*) (std::ostream&)>(std::endl));
else you have to specify which one you want
print(1, 2, 3, std::endl<char, std::char_traits<char>>);
or wrap it
print(1, 2, 3, [](std::ostream& o) -> std::ostream&{ return o << std::endl; });
Demo
print(1, 2, 3, std::endl<char, std::char_traits<char>>);, but you probably want a way to not have to write all that extra stuff.'\n'(instead ofstd::endl).\n,print(1, 2, 3, '\n');unless you absolutely must flush the stream too.