siplasplas
A library for C++ reflection and introspection
cpp::concepts::OStreamable< T, typename > Class Template Reference

Checks whether a vaue of type T can be written to a standard stream. More...

#include <siplasplas/typeerasure/concepts/iostream.hpp>

Inheritance diagram for cpp::concepts::OStreamable< T, typename >:
cpp::concepts::Concept< false >

Additional Inherited Members

- Static Public Attributes inherited from cpp::concepts::Concept< false >
static constexpr bool no_except
 

Detailed Description

template<typename T, typename = void>
class cpp::concepts::OStreamable< T, typename >

Checks whether a vaue of type T can be written to a standard stream.

This concept trait checks if values of a given type T can be written to an stream class using operator<<(std:ostream&, T).

Template Parameters
TType to check.
Returns
True if the type T has a operator<<(Stream, T) overload declared in this translation unit. False otherwise.
#include <siplasplas/typeerasure/concepts/iostream.hpp>
#include <vector>
#include <string>
using namespace cpp::concepts;
static_assert(!OStreamable<std::vector<int>>(), "vector is not ostreamable by default");
static_assert( OStreamable<std::string>(), "string is ostreamable");

The documentation for this class was generated from the following file: