PrevUpHomeNext

utx::kspt::printable


utx::kspt::printable - Utxcpp Output Concepts

utx::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 utx::printable, such as int, float, bool etc. the user-defined types can overload operator<< for std::ostream to satisfy utx::kspt::printable. Specially, std::string satisfies utx::kspt::printable; but std::wstring does not satisfy utx::kspt::printable, it satisfies utx::kspt::wprintable.

utx::kspt::printable

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

c++ exmaple

#include <utxcpp/core.hpp>

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

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

See Also

utx::kspt::wprintable

utx::kspt::printable_adapter

utx::print


PrevUpHomeNext

utx::print

esv::print