EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
dfe_namedtuple.hpp File Reference

Allow structs to be accessed like std::tuple. More...

#include <array>
#include <cassert>
#include <ostream>
#include <string>
#include <tuple>
#include <utility>
+ Include dependency graph for dfe_namedtuple.hpp:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

namespace  dfe
 
namespace  dfe::namedtuple_impl
 

Macros

#define DFE_NAMEDTUPLE(name,...)
 

Functions

template<std::size_t N>
constexpr std::array
< std::string, N > 
dfe::namedtuple_impl::unstringify (const char *str)
 
template<typename Names , typename Values , std::size_t... I>
std::ostream & dfe::namedtuple_impl::print_tuple (std::ostream &os, const Names &n, const Values &v, std::index_sequence< I...>)
 

Detailed Description

Allow structs to be accessed like std::tuple.

Author
Moritz Kiehn msmk@.nosp@m.cern.nosp@m..ch
Date
2015-06-00, Initial version
2018-02-09, Major rework
2019-09-09, Split i/o components into separate libraries
2020-10-13, Add support for direct use of get<I>(named_tuple)

Definition in file dfe_namedtuple.hpp.

Macro Definition Documentation

#define DFE_NAMEDTUPLE (   name,
  ... 
)

Enable tuple-like access and conversion for selected class/struct members.

This allows access to the selected members via .get<I>() or get<I>(...), conversion to equivalent std::tuple<...> via implicit conversion or explicitely via .tuple(), and assignment from equivalent tuples. The names can be accessed via names().

Definition at line 45 of file dfe_namedtuple.hpp.

View newest version in sPHENIX GitHub at line 45 of file dfe_namedtuple.hpp