https://github.com/tumdum/either_ptr
https://github.com/tumdum/either_ptr
cpp optimization
Last synced: 6 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/tumdum/either_ptr
- Owner: tumdum
- License: mit
- Created: 2018-02-08T17:35:29.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2018-02-08T17:56:52.000Z (over 8 years ago)
- Last Synced: 2024-01-29T00:07:59.291Z (over 2 years ago)
- Topics: cpp, optimization
- Language: C++
- Size: 3.91 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README
- License: LICENSE
Awesome Lists containing this project
README
tmd::either_ptr is type similar to boost::variant in concept. It differs
in few ways:
- it is always the same size as void*
- it allows for A to be the same type as B
- it can only store types with alignment of at least 2. To be precise it
requires passed pointer to have lowest bit set to zero.
To use it's enough to copy either_ptr.hpp and LICENSE files to your project.