template <typename T, int N>
inline
unsigned int memory_consumption (const T (&v)[N]);
-
+
/**
* Specialization of the
* determination of the memory
*/
inline
unsigned int memory_consumption (const std::vector<bool> &v);
-
+
/**
* Specialization of the
* determination of the memory
*/
inline
unsigned int memory_consumption (const std::vector<int> &v);
-
+
/**
* Specialization of the
* determination of the memory
*/
inline
unsigned int memory_consumption (const std::vector<double> &v);
-
+
/**
* Specialization of the
* determination of the memory
*/
inline
unsigned int memory_consumption (const std::vector<float> &v);
-
+
/**
* Specialization of the
* determination of the memory
*/
inline
unsigned int memory_consumption (const std::vector<char> &v);
-
+
/**
* Specialization of the
* determination of the memory
*/
inline
unsigned int memory_consumption (const std::vector<unsigned char> &v);
-
+
/**
* Specialization of the
* determination of the memory
inline
unsigned int memory_consumption (const std::vector<T *> &v);
- /**
+ /**
* Specialization of the
* determination of the memory
* consumption of a vector, here
* necessary for compatibility with
* IBM's xlC 5.0 compiler, and
* doesn't harm for other compilers
- * as well.
+ * as well.
*/
unsigned int memory_consumption (const std::vector<std::string> &v);
template <typename A, typename B>
inline
unsigned int memory_consumption (const std::pair<A,B> &p);
-
+
/**
* Return the amount of memory
* used by a pointer. Make sure
template <typename T>
inline
unsigned int memory_consumption (const T * const);
-
+
/**
* Return the amount of memory
* used by a pointer. Make sure
*/
inline
unsigned int memory_consumption (void * const);
-
+
/**
* Return the amount of memory used
* by a shared pointer. Make
template <typename T>
inline
unsigned int memory_consumption (const std_cxx1x::shared_ptr<T> &);
-
+
/**
* For all other types which are
* not explicitly listed: try if
{
return sizeof(bool);
}
-
-
-
+
+
+
inline
unsigned int memory_consumption (const char)
{
return sizeof(char);
}
-
+
inline
- unsigned int memory_consumption (const short int)
+ unsigned int memory_consumption (const short int)
{
return sizeof(short int);
}
-
+
inline
- unsigned int memory_consumption (const short unsigned int)
+ unsigned int memory_consumption (const short unsigned int)
{
return sizeof(short unsigned int);
}
inline
- unsigned int memory_consumption (const int)
+ unsigned int memory_consumption (const int)
{
return sizeof(int);
}
-
+
inline
- unsigned int memory_consumption (const unsigned int)
+ unsigned int memory_consumption (const unsigned int)
{
return sizeof(unsigned int);
}
}
-
+
inline
unsigned int memory_consumption (const std::string &s)
{
}
-
+
inline
unsigned int memory_consumption (const std::vector<int> &v)
{
return (v.capacity() * sizeof(int) +
sizeof(v));
}
-
-
+
+
inline
unsigned int memory_consumption (const std::vector<double> &v)
return (v.capacity() * sizeof(double) +
sizeof(v));
}
-
-
+
+
inline
unsigned int memory_consumption (const std::vector<float> &v)
return (v.capacity() * sizeof(float) +
sizeof(v));
}
-
-
-
+
+
+
inline
unsigned int memory_consumption (const std::vector<char> &v)
{
return (v.capacity() * sizeof(char) +
sizeof(v));
}
-
-
+
+
inline
unsigned int memory_consumption (const std::vector<unsigned char> &v)
{
}
-
+
template <typename T>
inline
unsigned int memory_consumption (const std::vector<T *> &v)
return (v.capacity() * sizeof(T *) +
sizeof(v));
}
-
-
+
+
template <typename A, typename B>
inline
unsigned int memory_consumption (const std::pair<A,B> &p)
memory_consumption(p.second));
}
-
-
+
+
template <typename T>
inline
unsigned int
}
-
+
template <typename T>
inline
unsigned int
return sizeof(T*);
}
-
-
+
+
inline
unsigned int
memory_consumption (void * const)
template <typename T>
inline
unsigned int
- memory_consumption (const std_cxx1x::shared_ptr<T> &ptr)
+ memory_consumption (const std_cxx1x::shared_ptr<T> &)
{
- return sizeof(ptr);
+ return sizeof(std_cxx1x::shared_ptr<T>);
}
-
-
-
+
+
+
template <typename T>
inline
unsigned int