16#ifndef dealii_memory_consumption_h
17#define dealii_memory_consumption_h
93 typename std::enable_if<std::is_fundamental<T>::value, std::size_t>::type
102 template <
typename T>
103 inline typename std::enable_if<!(std::is_fundamental<T>::value ||
104 std::is_pointer<T>::value),
121 template <
typename T>
129 template <
typename T, std::
size_t w
idth>
167 template <
typename T>
191 template <
typename T, std::
size_t N>
203 template <
typename T,
int N>
221 template <
typename A,
typename B>
234 template <
typename T>
243 template <
typename T>
252 template <
typename T>
263 template <
typename T>
265 typename std::enable_if<std::is_fundamental<T>::value, std::size_t>::type
276 if (
string ==
nullptr)
282 return sizeof(char) * (strlen(
string) + 1);
288 template <
typename T>
292 return sizeof(std::complex<T>);
297 template <
typename T, std::
size_t w
idth>
309 return sizeof(s) + s.length();
314 template <
typename T>
319 if (std::is_fundamental<T>::value || std::is_pointer<T>::value)
321 return v.capacity() *
sizeof(
T) +
sizeof(v);
325 std::size_t mem =
sizeof(std::vector<T>);
326 for (
unsigned int i = 0; i < v.size(); ++i)
330 mem += (v.capacity() - v.size()) *
sizeof(
T);
337 template <
typename T, std::
size_t N>
342 if (std::is_fundamental<T>::value || std::is_pointer<T>::value)
349 for (std::size_t i = 0; i !=
N; ++i)
357 template <
typename T,
int N>
362 for (
unsigned int i = 0; i <
N; ++i)
372 return v.capacity() / 8 +
sizeof(v);
377 template <
typename A,
typename B>
386 template <
typename T>
395 template <
typename T>
399 return sizeof(std::shared_ptr<T>);
404 template <
typename T>
408 return sizeof(std::unique_ptr<T>);
413 template <
typename T>
414 inline typename std::enable_if<!(std::is_fundamental<T>::value ||
415 std::is_pointer<T>::value),
419 return t.memory_consumption();
#define DEAL_II_NAMESPACE_OPEN
#define DEAL_II_NAMESPACE_CLOSE
std::enable_if< std::is_fundamental< T >::value, std::size_t >::type memory_consumption(const T &t)