Skip to content

C++ compile-time type tuple with several algorithms to imitate std::tuple behaviour

License

Notifications You must be signed in to change notification settings

janlaff/type_list

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 

Repository files navigation

type_list

C++ compile-time type tuple with several algorithms to imitate std::tuple behaviour

Examples

Adding types

using my_empty_list = type_list<>;
using my_list = my_empty_list::add<double, int>; // -> type_list<double, int>

or just

using my_list = type_list<double, int>;

Get size

using my_list = type_list<int, float>;

// my_list::size -> 2

Removing the first occurrence of a type

using my_list = type_list<double, float, double, char>;
using result = my_list::remove<float>; // -> type_list<double, double, char>

Remove all occurrences of one or more types

using my_list = type_list<double, float, double, char>;
using result = my_list::remove_all<double, char>; // -> type_list<float>

Get type at index

using my_list = type_list<int, float, char>;
using elem1 = my_list::get<1>; // float

Concat lists

using my_list = type_list<char, float>;
using my_list2 = type_list<int, std::string>;

using result = my_list::concat<my_list2>; // -> type_list<char, float, int, std::string>

Pretty easy, isn't it??

About

C++ compile-time type tuple with several algorithms to imitate std::tuple behaviour

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages