cast: remove unused 'validate' cast

This commit is contained in:
Danny Robson 2021-01-20 14:19:04 +10:00
parent 46645e4430
commit 2a16ac4163

View File

@ -11,7 +11,6 @@
#include "concepts.hpp" #include "concepts.hpp"
#include "debug/assert.hpp" #include "debug/assert.hpp"
#include "debug/validate.hpp"
#include "platform.hpp" #include "platform.hpp"
#include <string_view> #include <string_view>
@ -213,19 +212,6 @@ namespace cruft::cast {
} }
///////////////////////////////////////////////////////////////////////////
/// Cast from SrcT to DstT, performing sanity checks on the src and dst
/// values before returning the result.
template <typename DstT, typename SrcT>
DstT sanity (SrcT src)
{
cruft::debug::sanity (src);
DstT dst = static_cast<DstT> (src);
cruft::debug::sanity (dst);
return dst;
}
/// Convert from SrcT to DstT by reinterpreting the bits that make up SrcT. /// Convert from SrcT to DstT by reinterpreting the bits that make up SrcT.
/// Effectively a reinterpret_cast of SrcT but without the undefined /// Effectively a reinterpret_cast of SrcT but without the undefined
/// behaviour. /// behaviour.