A data sink is something that sucks up your data, taking ownership of it.
The terminology originates in the notion of "pipelines", where some particular entity in a chain of entities takes its data from a "source", then pushes its result to a "sink". The next entity in the chain does the same thing, and so forth. At each stage, the entity can no longer do anything with the data that it's passed on.
By analogy (and example), consider taking data from std::cin
(a stream acting as a source), doing some calculations then pushing the result to std::cout
(a stream acting as a sink). Once you're done, you're done; the results are out in the ether and you can't get them back.
That's what auto_ptr
does: it gives away ownership of your data, whether you wanted it to or not.
std::auto_ptr
, it got replaced bystd::unique_ptr
and is deprecated in C++11. In C++17 it will be removed from the standard library. – Guthrey