bit_cast icon indicating copy to clipboard operation
bit_cast copied to clipboard

bit_cast

Bit-casting object representations

Sample implementation for the C++ standards committee paper on bit_cast.

The implementation conforms to the API as described in the paper, and showcases concept checking using:

  • C++ concepts from the Concepts TS, as available in GCC 6 and later.
  • SFINAE.
  • enable_if.

The associated tests try to hit interesting / horrible uses of this feature.