Skip to content

Commit 742138d

Browse files
authored
Avoid warning in launder_cast
This fixes a warning for `launder_cast<char*>(ptr)` as it adds `const` in the argument and then C-casts it away which triggers `-Wcast-qual`
1 parent 1d398dd commit 742138d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

include/boost/move/detail/launder.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ BOOST_MOVE_FORCEINLINE T* launder(T* p)
4444
template<class T>
4545
BOOST_MOVE_FORCEINLINE T launder_cast(const volatile void* p)
4646
{
47-
return (launder)((T)p);
47+
return (launder)(static_cast<T>(const_cast<void*>(p)));
4848
}
4949

5050
} //namespace move_detail {

0 commit comments

Comments
 (0)