File tree 1 file changed +9
-2
lines changed
1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change 63
63
#define JSON_DTO_NODISCARD
64
64
#endif
65
65
66
+ // Handle the presence of std::launder.
67
+ #if __cpp_lib_launder >= 201606L
68
+ #define JSON_DTO_STD_LAUNDER (x ) std::launder(x)
69
+ #else
70
+ #define JSON_DTO_STD_LAUNDER (x ) x
71
+ #endif
72
+
66
73
namespace json_dto
67
74
{
68
75
@@ -1161,13 +1168,13 @@ struct nullable_t
1161
1168
Field_Type *
1162
1169
field_ptr () noexcept
1163
1170
{
1164
- return reinterpret_cast < Field_Type * >( m_image_space );
1171
+ return JSON_DTO_STD_LAUNDER ( reinterpret_cast < Field_Type * >( m_image_space ) );
1165
1172
}
1166
1173
1167
1174
const Field_Type *
1168
1175
field_ptr () const noexcept
1169
1176
{
1170
- return reinterpret_cast < const Field_Type * >( m_image_space );
1177
+ return JSON_DTO_STD_LAUNDER ( reinterpret_cast < const Field_Type * >( m_image_space ) );
1171
1178
}
1172
1179
1173
1180
Field_Type &
You can’t perform that action at this time.
0 commit comments