C++ Library Extensions 2022.12.09
To help learn modern C++ programming
33-variant_tuple_output.cpp File Reference
#include <iostream>
#include <type_traits>
#include <tuple>
#include <variant>
Include dependency graph for 33-variant_tuple_output.cpp:

Go to the source code of this file.

Classes

struct  tutorial::is_variant_st< Type >
 
struct  tutorial::is_variant_st< std::variant< Types... > >
 
struct  tutorial::is_tuple_st< Type >
 
struct  tutorial::is_tuple_st< std::tuple< Types... > >
 
struct  tutorial::static_loop< StartIndex, EndIndex >
 

Namespaces

namespace  tutorial
 

Typedefs

template<typename Type >
using tutorial::remove_cv_ref_t = std::remove_cv_t< std::remove_reference_t< Type > >
 

Functions

template<typename... Types>
void tutorial::print_tuple (std::ostream &os, const std::tuple< Types... > &tpl)
 
template<typename Type , typename... Types>
void tutorial::print_variant (std::ostream &os, const std::variant< Type, Types... > &vrt)
 
template<typename... Types>
std::ostream & tutorial::operator<< (std::ostream &os, const std::tuple< Types... > &tpl)
 
template<typename Type , typename... Types>
std::ostream & tutorial::operator<< (std::ostream &os, const std::variant< Type, Types... > &vrt)
 
void test_simple_tuple_variant ()
 
void test_advanced_tuple_variant ()
 
int main ()
 

Variables

template<typename Type >
constexpr bool tutorial::is_variant_v = is_variant_st<remove_cv_ref_t<Type>>::value
 
template<typename Type >
constexpr bool tutorial::is_tuple_v = is_tuple_st<remove_cv_ref_t<Type>>::value
 

Function Documentation

◆ main()

int main ( )

Definition at line 224 of file 33-variant_tuple_output.cpp.

Here is the call graph for this function:

◆ test_advanced_tuple_variant()

void test_advanced_tuple_variant ( )

Definition at line 191 of file 33-variant_tuple_output.cpp.

Here is the caller graph for this function:

◆ test_simple_tuple_variant()

void test_simple_tuple_variant ( )

Definition at line 170 of file 33-variant_tuple_output.cpp.