From d6ba845e0635ea1e94091d85c90abaf743b0703e Mon Sep 17 00:00:00 2001 From: Wolfgang Bangerth Date: Thu, 17 May 2001 14:46:11 +0000 Subject: [PATCH] Work around a bug in Intel's C++ compiler: the decision whether to choose a function or a template with the same name was based on the availability of the implementations, rather than the declarations alone! Provide the implementation to make the compiler choose the right function... git-svn-id: https://svn.dealii.org/trunk@4654 0785d39b-7218-0410-832d-ea1e28bc413d --- .../base/include/base/memory_consumption.h | 20 ++++++------------- deal.II/base/source/memory_consumption.cc | 14 ------------- 2 files changed, 6 insertions(+), 28 deletions(-) diff --git a/deal.II/base/include/base/memory_consumption.h b/deal.II/base/include/base/memory_consumption.h index bc3e780483..6dfcf17f1d 100644 --- a/deal.II/base/include/base/memory_consumption.h +++ b/deal.II/base/include/base/memory_consumption.h @@ -146,20 +146,6 @@ 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 @@ -443,6 +429,12 @@ namespace MemoryConsumption + 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; diff --git a/deal.II/base/source/memory_consumption.cc b/deal.II/base/source/memory_consumption.cc index 12931fb2ba..315d9f8fde 100644 --- a/deal.II/base/source/memory_consumption.cc +++ b/deal.II/base/source/memory_consumption.cc @@ -17,20 +17,6 @@ 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 &v) { unsigned int mem = sizeof(v); -- 2.39.5