PrevUpHomeNext

esv::kspt::printable


Wild animals are our friends.

esv::kspt::printable - Esvcpp Output Concepts

esv::kspt::printable concept is used to constrain a type is a std::ostream printable type. The type must satisfy prinable by std::ostream. Many basic types of the c++ language base satisfy esv::printable, such as int, float, bool etc. the user-defined types can overload operator<< for std::ostream to satisfy esv::kspt::printable. Specially, std::string satisfies esv::kspt::printable; but std::wstring does not satisfy esv::kspt::printable, it satisfies esv::kspt::wprintable.

esv::kspt::printable

template <typename type1>
concept printable = ???;

c++ exmaple

#include <esvcpp/core.hpp>

template <esv::kspt::printable type1>
class foo_bar
{
public:
	foo_bar(const type1 & value1)
	{
		std::cout << value1 << std::endl;
		esv::print(value1);
	}
};

int main()
{
	foo_bar<int> f1{123};
	foo_bar<std::string> f2{"Hello, c++!"};
}

See Also

esv::kspt::wprintable

esv::kspt::printable_adapter

esv::print


PrevUpHomeNext

E