[Trilinos-Users] [12.2.1] compiler error with Teuchos on Clang

Denis Davydov davydden at gmail.com
Thu Sep 3 17:44:04 EDT 2015


Dear all, 

it seems that Teuchos::Details::Allocator is missing std::allocator::max_size http://en.cppreference.com/w/cpp/memory/allocator/max_size
Do you think the patch below is the correct way to do it (I am just guessing here) ?

Regards,
Denis.

---

diff --git a/packages/teuchos/core/src/Teuchos_Details_Allocator.hpp b/packages/teuchos/core/src/Teuchos_Details_Allocator.hpp
index fc4c408..d44af4c 100644
--- a/packages/teuchos/core/src/Teuchos_Details_Allocator.hpp
+++ b/packages/teuchos/core/src/Teuchos_Details_Allocator.hpp
@@ -282,6 +282,11 @@ public:
   ///   the rebind struct is required.
   template<class U>
   struct rebind { typedef Allocator<U> other; };
+  
+  size_type max_size() const
+  {
+     return std::numeric_limits<size_type>::max();
+  }
 
   /// \brief Allocate an array of n instances of value_type.
   ///


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://trilinos.org/pipermail/trilinos-users/attachments/20150903/8b21258d/attachment.html>


More information about the Trilinos-Users mailing list