Skip to content

efremale/variant

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Variant

An example of a std::variant-like type implementation.

The implementation creates dispatch table at compile time. Therefore, the invocation of the callable object in visit function is guaranteed to be is in constant time, independently of the number of types in variant.

This implementation has no constexpr support, because reinterpret_cast and placement new (::new (ptr) T (val)) are currently not allowed in constexpr context. An implementation with constexpr support is discussed e.g here

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages