Skip to content

Contains tagged_union a C++ equivalent to Pascal/Algol variant record

License

Notifications You must be signed in to change notification settings

PiotrNycz/tagged_union

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

tagged_union

Contains:

  • tagged_union: like boost::variant but accessed by tag - tag can be enum value,
    
      enum discriminator { name, number, dimensions };
      exp::tagged_union<discriminator>
                ::with<name>::as<std::string>
                ::with<number>::as<int>
                ::with<dimensions>::as<std::vector<int>>::type a, b;
      
  • unrestricted_union: implementation of C++11 unrestricted union - like std::tuple to simple struct
    
      exp::unrestricted_union<std::string,int,std::vector<int>> a, b;
      
  • indexed_union: like boost::variant but based on C++11 unrestricted union
    
      exp::indexed_union<std::string,int,std::vector<int>> a, b;
      

    TODO:

    • tagged_tuple
    • tagged_array
    • optional - based on tagged_union tagged with bool:true and bool:false

About

Contains tagged_union a C++ equivalent to Pascal/Algol variant record

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published