8000 GitHub - tedsta/Reflectable: A C++11 header only library built from code stolen from around the internet to allow compile-time reflection.
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
This repository was archived by the owner on Feb 5, 2020. It is now read-only.
/ Reflectable Public archive

A C++11 header only library built from code stolen from around the internet to allow compile-time reflection.

Notifications You must be signed in to change notification settings

tedsta/Reflectable

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Reflectable

A C++11 header only library built from code stolen from around the internet to allow compile-time reflection.

This whole thing is build on std::tuple.

Much Thanks

Much thanks to the template wizards who really wrote this code. All I did was steal their code and glue it together :)

Iterating through a std::tuple

Tagged tuples (The real heart and soul)

Limitations

Member variable names use structs as tags for the compiler. This means that no other symbols can conflict with the variable names in your reflectable objects, which sucks. You can, however, reuse variable names across multiple reflectable objects.

Benchmarks

Without compiler optimizations

Raw for loop: 0.53s
Regular access: 0.597s
Reflectable access: 3.782s
Reflectable with reference access: 0.559s

With compiler optimizations (-O)

Raw for loop: 0.084s
Regular access: 0.086s
Reflectable access: 0.084s
Reflectable with reference access: 0.104s

With compiler optimizations (-O1)

Raw for loop: 0.085s
Regular access: 0.085s
Reflectable access: 0.085s
Reflectable with reference access: 0.104s

About

A C++11 header only library built from code stolen from around the internet to allow compile-time reflection.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published
0