digestpp 1.0
C++11 header-only message digest library
Loading...
Searching...
No Matches
traits.hpp
Go to the documentation of this file.
1/*
2This code is written by kerukuro and released into public domain.
3*/
4
5#ifndef DIGESTPP_DETAIL_TRAITS_HPP
6#define DIGESTPP_DETAIL_TRAITS_HPP
7
8#include <cstddef> // needed for testing std::byte
9
10namespace digestpp
11{
12namespace detail
13{
14
15template <typename T>
16struct is_xof
17{
18 static const bool value = T::is_xof;
19};
20
21template <typename T>
22struct is_byte
23{
24 static const bool value = std::is_same<T, char>::value ||
25 std::is_same<T, signed char>::value ||
26#if (defined(_HAS_STD_BYTE) && _HAS_STD_BYTE) || (defined(__cpp_lib_byte) && __cpp_lib_byte >= 201603)
27 std::is_same<T, std::byte>::value ||
28#endif
29 std::is_same<T, unsigned char>::value;
30};
31
32} // namespace detail
33} // namespace digestpp
34
35#endif // DIGESTPP_DETAIL_TRAITS_HPP
digestpp namespace
Definition ascon.hpp:14
Definition traits.hpp:23
static const bool value
Definition traits.hpp:24
Definition traits.hpp:17
static const bool value
Definition traits.hpp:18