From: Wolfgang Bangerth Date: Thu, 17 May 2001 13:50:49 +0000 (+0000) Subject: Work around a overload resolution and partial ordering bug in Intel's X-Git-Tag: v8.0.0~19143 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8a6cecc965a4a5738231f9a3f33cfcee0f7c4c15;p=dealii.git Work around a overload resolution and partial ordering bug in Intel's ICC compiler. git-svn-id: https://svn.dealii.org/trunk@4651 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/base/include/base/memory_consumption.h b/deal.II/base/include/base/memory_consumption.h index 0035ff8658..bc3e780483 100644 --- a/deal.II/base/include/base/memory_consumption.h +++ b/deal.II/base/include/base/memory_consumption.h @@ -146,6 +146,20 @@ namespace MemoryConsumption */ 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 diff --git a/deal.II/base/source/memory_consumption.cc b/deal.II/base/source/memory_consumption.cc index c33f7c51c8..12931fb2ba 100644 --- a/deal.II/base/source/memory_consumption.cc +++ b/deal.II/base/source/memory_consumption.cc @@ -24,6 +24,13 @@ namespace MemoryConsumption + unsigned int memory_consumption (std::string &s) + { + return sizeof(s) + s.length(); + }; + + + unsigned int memory_consumption (const std::vector &v) { unsigned int mem = sizeof(v);