]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Work around a bug in Intel's C++ compiler: the decision whether to
authorWolfgang Bangerth <bangerth@math.tamu.edu>
Thu, 17 May 2001 14:46:11 +0000 (14:46 +0000)
committerWolfgang Bangerth <bangerth@math.tamu.edu>
Thu, 17 May 2001 14:46:11 +0000 (14:46 +0000)
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

deal.II/base/include/base/memory_consumption.h
deal.II/base/source/memory_consumption.cc

index bc3e780483154d4a06a190af23de4fca6aafb538..6dfcf17f1d3e16025087473ee85fe1e6f0a23fa1 100644 (file)
@@ -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;
index 12931fb2ba3afe0ba8c1c315c2fe4ec9edccdf17..315d9f8fde71439a3432704b5b307e7b2f244687 100644 (file)
 
 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);

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.