PrevUpHomeNext

utx::kspt::printable_adapter


utx::kspt::printable_adapter - Utxcpp Output Concepts

utx::kspt::printable_adapter concept is used to constrain a type to be printable judged by another character type. Because there are many different locale systems, it must have a overrule concept to decide what locale-related printable by another character base.

utx::kspt::printable_adapter

template <typename type1, typename type2>
concept printable_adapter = ???;

type1 is the target type to be constrained, type2 is the locale-related character type. Currently only char and wchar_t are accepted to type2, as c++ standard has implmented std::cout for char based, and std::wcout for wchar_t based.

c++ example

#include <utxcpp/core.hpp>

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

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

See Also

utx::kspt::printable

utx::kspt::wprintable

utx::print


PrevUpHomeNext

utx::print

esv::print