Skip to content

About

A quick C++ library for making "switch" statements based on types

Resources

Stars

0 stars

Watchers

1 watching

Forks

Latest commit

 

History

14 Commits

Folders and files

Repository files navigation

TypeSwitch:

This library allows one to write code like:

Switch ( arg, Case( [&](const WType1& arg) { }), Case( [&](const WType2& arg) { Switch ( arg, Case( [&](const WDerivedFromType2& arg) { }), IgnoreOthers ()); }), Case( [&](const WType3& arg) { }), OneOf<WType4, WType5, WType6>( [&](const Arg& arg) { }),
Otherwise ( [&](const Arg& arg) { }));

where arg is of some base type and WType1, WType2, etc. are derived types. This avoids having have a bunch of if's and dynamic_casts spalyed all over your code.

About

A quick C++ library for making "switch" statements based on types

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages