#endif
#include <gtestgtest.h>
using namespace DB;
namespace
{
template <class T> using is_pod = std::is_trivial<std::is_standard_layout<T>>;
template <class T> inline constexpr bool is_pod_v = is_pod<T>::value;
template <typename T>
struct AsHexStringHelper
{
    const T & container;
};
template <typename T>
std::ostream & operator << (std::ostream & ostr, const AsHexStringHelper<T> & helper)
{
    ostr << std::hex;
    for (const auto & e : helper.container)
    {
        ostr << "\\x" << std::setw(2) << std::setfill('0') << (static_cast<unsigned int>(e) & 0xFF);
    }
    return ostr;
}
template <typename T>
AsHexStringHelper<T> AsHexString(const T & container)
{
    static_assert (sizeof(container[0]) == 1 && is_pod_v<std::decay_t<decltype(container[0])>>, "Only works on containers of byte-size PODs.");
    return AsHexStringHelper<T>{container};
}
template <typename T>
std::string bin(const T & value, size_t bits = sizeof(T)*8)