Stroika Library 3.0d16
 
Loading...
Searching...
No Matches
IterableToInputStream.h File Reference
#include "Stroika/Foundation/StroikaPreComp.h"
#include "Stroika/Foundation/Streams/InputStream.h"
#include "Stroika/Foundation/Traversal/Iterable.h"
#include "IterableToInputStream.inl"

Go to the source code of this file.

Namespaces

namespace  Stroika::Foundation
 

Functions

template<typename ELEMENT_TYPE >
auto Stroika::Foundation::Streams::IterableToInputStream::New (const Traversal::Iterable< ELEMENT_TYPE > &it) -> Ptr< ELEMENT_TYPE >
 

Detailed Description

Note
Code-Status: Beta

Definition in file IterableToInputStream.h.

Function Documentation

◆ New()

template<typename ELEMENT_TYPE >
auto Stroika::Foundation::Streams::IterableToInputStream::New ( const Traversal::Iterable< ELEMENT_TYPE > &  it) -> Ptr<ELEMENT_TYPE>

Sometimes, convenient to take an object which is Iterable, and treat it as an InputStream<> (similar but not identical concepts).

For example, this can be used to treat a String as an InputStream<Character>.

Example Usage
InputStream::Ptr<Character> in = IterableToInputStream::New<Character> (String{"hi"});

Definition at line 14 of file IterableToInputStream.inl.