16#ifndef dealii_memory_consumption_h
17#define dealii_memory_consumption_h
92 inline std::enable_if_t<std::is_fundamental<T>::value, std::size_t>
101 template <
typename T>
102 inline std::enable_if_t<!(std::is_fundamental<T>::value ||
103 std::is_pointer<T>::value),
120 template <
typename T>
128 template <
typename T, std::
size_t w
idth>
166 template <
typename T>
190 template <
typename T, std::
size_t N>
202 template <
typename T,
int N>
220 template <
typename A,
typename B>
233 template <
typename T>
242 template <
typename T>
251 template <
typename T>
262 template <
typename T>
263 inline std::enable_if_t<std::is_fundamental<T>::value, std::size_t>
274 if (
string ==
nullptr)
280 return sizeof(char) * (strlen(
string) + 1);
286 template <
typename T>
290 return sizeof(std::complex<T>);
295 template <
typename T, std::
size_t w
idth>
307 return sizeof(s) + s.size();
312 template <
typename T>
317 if (std::is_fundamental<T>::value || std::is_pointer<T>::value)
319 return v.capacity() *
sizeof(T) +
sizeof(v);
323 std::size_t mem =
sizeof(std::vector<T>);
324 for (
unsigned int i = 0; i < v.size(); ++i)
328 mem += (v.capacity() - v.size()) *
sizeof(T);
335 template <
typename T, std::
size_t N>
340 if (std::is_fundamental<T>::value || std::is_pointer<T>::value)
347 for (std::size_t i = 0; i != N; ++i)
355 template <
typename T,
int N>
360 for (
unsigned int i = 0; i < N; ++i)
370 return v.capacity() / 8 +
sizeof(v);
375 template <
typename A,
typename B>
384 template <
typename T>
393 template <
typename T>
397 return sizeof(std::shared_ptr<T>);
402 template <
typename T>
406 return sizeof(std::unique_ptr<T>);
411 template <
typename T>
412 inline std::enable_if_t<!(std::is_fundamental<T>::value ||
413 std::is_pointer<T>::value),
417 return t.memory_consumption();
#define DEAL_II_NAMESPACE_OPEN
#define DEAL_II_NAMESPACE_CLOSE
std::enable_if_t< std::is_fundamental< T >::value, std::size_t > memory_consumption(const T &t)