Skip to content

[cpp, c++] utx::print_tuples: print many tuples (std::tuple)


If you want to print all elements of std::tuple, or you want to print all elements of all tuples, utx::print_tuples will serve for you.

How to use utx::print_tuples: just pass all tuples you want to print to utx::print_tuples.

utx::print_tuples(tuple1, tuple2, tuple3, ...);

Utxcpp Project:

utx::print_tuples doc:

An example

#include <utxcpp/core.hpp>
#include <tuple>
#include <complex>
using namespace utx::string_literals;                                             
using namespace std::complex_literals;
int main()
        auto t1 = std::make_tuple(123, true, "utxcpp"_us);
        const auto t2 = std::make_tuple(1, 2, 3, 1.2+2.3i);
        constexpr auto t3 = std::make_tuple(123i, 1.2+3.0i, false);

        utx::print_tuples(t1, t2, t3);

        utx::print_tuples(std::move(t1), std::move(t2),
                std::move(t3), std::make_tuple("utxcpp"s));



123 true utxcpp
1 2 3 (1.200000,2.300000)
(0.000000,123.000000) (1.200000,3.000000) false

123 true utxcpp
1 2 3 (1.200000,2.300000)                                                         
(0.000000,123.000000) (1.200000,3.000000) false

123 true utxcpp





No Trackbacks


Display comments as Linear | Threaded

No comments

Add Comment

E-Mail addresses will not be displayed and will only be used for E-Mail notifications.

To prevent automated Bots from commentspamming, please enter the string you see in the image below in the appropriate input box. Your comment will only be submitted if the strings match. Please ensure that your browser supports and accepts cookies, or your comment cannot be verified correctly.

Form options

Submitted comments will be subject to moderation before being displayed.