Skip to content

A space-efficient partial reimplementation of std::tuple

Notifications You must be signed in to change notification settings

rdbuf/tinytuple

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 

Repository files navigation

Aimed at a partial implementation of std::tuple.

Relies on an unspecified property of the base class subobjects layout: it is assumed they get laid out trivially, in the order of derivation.

For such a case this implementation optimizes the layout, taking the alignment requirements of each type into account and minimizing padding:

static_assert(sizeof(tiny::tuple<bool, long, char, bool, int, bool>) == 16);
static_assert(sizeof(std::tuple<bool, long, char, bool, int, bool>) == 32);

Inspired by the two brilliant talks:

About

A space-efficient partial reimplementation of std::tuple

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages