MeshLib C++ Docs
Loading...
Searching...
No Matches
MRBitCast.h
Go to the documentation of this file.
1
#pragma once
2
3
#include <version>
4
5
#if __cpp_lib_bit_cast >= 201806L
6
#include <bit>
7
#endif
8
9
namespace
MR
10
{
13
14
16
template
<
typename
To,
typename
From>
17
[[nodiscard]]
constexpr
To
bit_cast
(
const
From& from )
noexcept
18
{
19
#if __cpp_lib_bit_cast >= 201806L
20
return
std::bit_cast<To>( from );
21
#else
22
return
__builtin_bit_cast( To, from );
23
#endif
24
}
25
26
}
MR::bit_cast
constexpr To bit_cast(const From &from) noexcept
std::bit_cast wrapper with the compiler's intrinsic fallback
Definition
MRBitCast.h:17
MR
only for bindings generation
Definition
MRCameraOrientationPlugin.h:8
MRMesh
MRBitCast.h
Generated by
1.14.0