Program Listing for File memory.h

Return to documentation for file (include/coal/serialization/memory.h)

//
// Copyright (c) 2021 INRIA
//

#ifndef COAL_SERIALIZATION_MEMORY_H
#define COAL_SERIALIZATION_MEMORY_H

namespace coal {

namespace internal {
template <typename T>
struct memory_footprint_evaluator {
  static size_t run(const T &) { return sizeof(T); }
};
}  // namespace internal

template <typename T>
size_t computeMemoryFootprint(const T &object) {
  return internal::memory_footprint_evaluator<T>::run(object);
}

}  // namespace coal

#endif  // ifndef COAL_SERIALIZATION_MEMORY_H