*/
unsigned int memory_consumption (const std::string &s);
- /**
- * Determine an estimate of the
- * amount of memory in bytes
- * consumed by a @p{std::string}
- * variable. This function is there
- * to work around a bug in Intel's
- * ICC compiler which would have
- * taken the general template
- * instead of the above function
- * when presented with a non-const
- * string.
- */
- unsigned int memory_consumption (std::string &s);
-
/**
* Determine an estimate of the
* amount of memory in bytes
+ unsigned int memory_consumption (const std::string &s)
+ {
+ return sizeof(s) + s.length();
+ };
+
+
// if necessary try to work around a bug in the IBM xlC compiler
#ifdef XLC_WORK_AROUND_STD_BUG
using namespace std;
namespace MemoryConsumption
{
- unsigned int memory_consumption (const std::string &s)
- {
- return sizeof(s) + s.length();
- };
-
-
-
- unsigned int memory_consumption (std::string &s)
- {
- return sizeof(s) + s.length();
- };
-
-
-
unsigned int memory_consumption (const std::vector<std::string> &v)
{
unsigned int mem = sizeof(v);