[cpp, c++] utx::kspt::printable_tuple, utx::kspt::tuple, utx::kspt::printale (utxcpp)
utx::kspt::printable_tuple
A c++ concept in utxcpp library. The type of every element of the tuple must satisfy utx::printable.
utx::kspt::tuple
A c++ concept in utxcpp library. The type must be std::tuple type.
utx::kspt::printable
A c++ concept in utxcpp library. For example, std::string and utx::string satisfy utx::kspt::printable, but utx::Pest does not satisfy utx::kspt::printable.
utx::print_tuples doc: https://cppfx.xyz/fx/static/docs/utxcpp/html/utx_print_tuples.html
Example
T1 satisfy utx::kspt::printable_tuple, and utx::kspt::tuple, but does not satisfy utx::kspt::printable. Satisfying utx::kspt::printable_tuple does not mean satisfying utx::kspt::printable.
T2 does not satisfy utx::kspt::printable_tuple, but satisfy utx::kspt::tuple, because utx::Pest does not satisfy utx::kspt::printable.
#include <utxcpp/core.hpp> #include <tuple> #include <complex> using namespace utx::string_literals; using namespace std::complex_literals; template <utx::kspt::printable_tuple T> class fizz {}; template <utx::kspt::tuple T> class buzz {}; template <utx::kspt::printable T> class but {}; template <typename T> class fit {}; int main() { using T1 = std::tuple<float, int, utx::string>; using T2 = std::tuple<float, std::string, utx::Pest>; using T3 = float; using T4 = utx::Pest; fizz<T1>{}; buzz<T1>{}; // but<T1>{}; // T1 does not satisfy utx::kspt::printable // fizz<T2>{}; // T2 does not satisfy utx::kspt::printbale_tuple buzz<T2>{}; // fizz<T3>{}; // buzz<T3>{}; but<T3>{}; //but<T4>{}; fit<T4>{}; }
Comments
Display comments as Linear | Threaded