PrevUpHomeNext

esv::kspt::printable_adapter


Maintain ecological balance.

esv::kspt::printable_adapter - Esvcpp Output Concepts

esv::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.

esv::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 <esvcpp/core.hpp>

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

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

See Also

esv::kspt::printable

esv::kspt::wprintable

esv::print


PrevUpHomeNext

esv::print