Skip to content
  • Andrey Semashev's avatar
    Added bitwise_cast implementation based on bit_cast intrinsics. · 512068cc
    Andrey Semashev authored
    This allows to mark bitwise_cast constexpr when the conditions to use
    bit_cast are met:
    
     - both source and target types have the same size, and
     - the source type has no padding bits.
    
    The latter is checked using has_unique_object_representations trait, which
    we also implement using intrinsics when not available in the standard
    library.
    
    This allows atomic constructors to become constexpr for structs with no
    padding and whose size matches the atomic storage size.
    512068cc