di 0.1.0
Loading...
Searching...
No Matches
bit_cast.h
Go to the documentation of this file.
1#pragma once
2
3#ifndef DI_NO_USE_STD
4#include <bit>
5#else
6#include <di/meta/trivial.h>
7
8namespace std {
9template<di::concepts::TriviallyCopyable To, di::concepts::TriviallyCopyable From>
10requires(sizeof(To) == sizeof(From))
11constexpr auto bit_cast(From const& value) noexcept -> To {
12 return __builtin_bit_cast(To, value);
13}
14}
15#endif
16
17namespace di::util {
18using std::bit_cast;
19}
20
21namespace di {
22using util::bit_cast;
23}
Definition vocab.h:96
Definition any_storable.h:9
Definition enable_generate_structed_bindings.h:46