sharg 1.0.0
THE argument parser for bio-c++ tools.
sharg::ostreamable Concept Reference

Concept for types that can be parsed into a std::ostream via the stream operator. More...

#include <sharg/concept.hpp>

Concept definition

template<typename type>
concept sharg::ostreamable = requires (std::ostream & os, type & val)
{
{os << val} -> std::same_as<std::ostream&>;
}
||
requires (std::ostream & os, std::ranges::range_reference_t<type> val)
{
{os << val} -> std::same_as<std::ostream&>;
}
Concept for types that can be parsed into a std::ostream via the stream operator.
Definition: concept.hpp:64

Detailed Description

Concept for types that can be parsed into a std::ostream via the stream operator.

Template Parameters
typeThe type to check whether it's stremable via std::ostream or it's a container over streamable values.

Read up on how to make a type model this concept here:

How to make your custom type model sharg::parsable.

Requirements

std::ostream must support the (un)formatted output function (operator<<) for an l-value of a given type or for an l-value of type::reference.

This entity is stable. Since version 1.0.