hyperledger/iroha
Iroha - A simple, decentralized ledger http://iroha.tech
mem_operations.hpp
Go to the documentation of this file.
1 
6 #ifndef IROHA_COMMON_MEM_OPERATIONS_HPP
7 #define IROHA_COMMON_MEM_OPERATIONS_HPP
8 
9 #include <cstring>
10 
11 namespace iroha {
12 
13  template <typename T>
14  void memzero(T &t) {
15  static_assert(std::is_pod<T>::value, "T must be POD.");
16  std::memset(&t, 0, sizeof(t));
17  }
18 
19  template <typename T>
20  void memcpy(T &dst, T const &src) {
21  static_assert(std::is_pod<T>::value, "T must be POD.");
22  std::memcpy(&dst, &src, sizeof(src));
23  }
24 } // namespace iroha
25 
26 #endif // IROHA_COMMON_MEM_OPERATIONS_HPP
void memcpy(T &dst, T const &src)
Definition: mem_operations.hpp:20
Definition: block_query.hpp:15
void memzero(T &t)
Definition: mem_operations.hpp:14