C++ Range based stream Hoping somebody has knowledge of the range based additions going into the standard. So they can point out all the things I need to add to make it compliant.
IterableStream.h
#include &lt;iostream&gt;
#include &lt;iterator&gt;

namespace ThorsAnvil::Util
{
    
template&lt;typename T&gt;
class IterableStream
{
    std::istream&amp;      stream;
    public:
        IterableStream(std::istream&amp; stream)
            : stream(stream)
        {}
        operator std::istream&amp;()            {return stream;}

        std::istream_iterator&lt;T&gt; begin()    {return std::istream_iterator&lt;T&gt;(stream);}
        std::istream_iterator&lt;T&gt; end()      {return std::istream_iterator&lt;T&gt;();}
};

}

Example usage
#include &quot;IterableStream.h&quot;
#include &lt;iostream&gt;
#include &lt;fstream&gt;

namespace TaU = ThorsAnvil::Util;
int main()
{
    std::ifstream x(&quot;plop&quot;);

    for(auto const&amp; y: TaU::IterableStream&lt;int&gt;(x)) {
        std::cout &lt;&lt; y &lt;&lt; &quot;\n&quot;;
    }
}
I don't like the name - it ought to be more explicit that it's an input-only range.

Otherwise, it looks just as a range should, with the observation that we omit the usual const iterators, as they don't make sense here.

I think you can avoid repetition of the return type:

std::istream_iterator&lt;T&gt; begin()    {return {stream};}
std::istream_iterator&lt;T&gt; end()      {return {};}