15#ifndef dealii_memory_consumption_h
16#define dealii_memory_consumption_h
92 inline std::enable_if_t<std::is_fundamental_v<T>, std::size_t>
101 template <
typename T>
102 inline std::enable_if_t<!(std::is_fundamental_v<T> || std::is_pointer_v<T>),
119 template <
typename T>
127 template <
typename T, std::
size_t w
idth>
165 template <
typename T>
189 template <
typename T, std::
size_t N>
201 template <
typename T,
int N>
219 template <
typename A,
typename B>
227 template <
typename A>
240 template <
typename T>
249 template <
typename T>
258 template <
typename T>
269 template <
typename T>
270 inline std::enable_if_t<std::is_fundamental_v<T>, std::size_t>
281 if (
string ==
nullptr)
287 return sizeof(char) * (strlen(
string) + 1);
293 template <
typename T>
297 return sizeof(std::complex<T>);
302 template <
typename T, std::
size_t w
idth>
314 return sizeof(s) + s.size();
319 template <
typename T>
324 if (std::is_fundamental_v<T> || std::is_pointer_v<T>)
326 return v.capacity() *
sizeof(T) +
sizeof(v);
330 std::size_t mem =
sizeof(std::vector<T>);
331 for (
unsigned int i = 0; i < v.size(); ++i)
335 mem += (v.capacity() - v.size()) *
sizeof(T);
342 template <
typename T, std::
size_t N>
347 if (std::is_fundamental_v<T> || std::is_pointer_v<T>)
354 for (std::size_t i = 0; i != N; ++i)
362 template <
typename T,
int N>
367 for (
unsigned int i = 0; i < N; ++i)
377 return v.capacity() / 8 +
sizeof(v);
382 template <
typename A,
typename B>
391 template <
typename A>
416 template <
typename T>
425 template <
typename T>
429 return sizeof(std::shared_ptr<T>);
434 template <
typename T>
438 return sizeof(std::unique_ptr<T>);
443 template <
typename T>
444 inline std::enable_if_t<!(std::is_fundamental_v<T> || std::is_pointer_v<T>),
448 return t.memory_consumption();
#define DEAL_II_NAMESPACE_OPEN
#define DEAL_II_NAMESPACE_CLOSE
std::enable_if_t< std::is_fundamental_v< T >, std::size_t > memory_consumption(const T &t)