[llvm] r264321 - Stop relying on mapped_iterator's function having a result_type. That facility

Richard Smith via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 24 12:10:58 PDT 2016


Author: rsmith
Date: Thu Mar 24 14:10:58 2016
New Revision: 264321

URL: http://llvm.org/viewvc/llvm-project?rev=264321&view=rev
Log:
Stop relying on mapped_iterator's function having a result_type. That facility
is deprecated in modern C++ and unnecessary since decltype can be used to query
the relevant type.

Modified:
    llvm/trunk/include/llvm/ADT/STLExtras.h

Modified: llvm/trunk/include/llvm/ADT/STLExtras.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ADT/STLExtras.h?rev=264321&r1=264320&r2=264321&view=diff
==============================================================================
--- llvm/trunk/include/llvm/ADT/STLExtras.h (original)
+++ llvm/trunk/include/llvm/ADT/STLExtras.h Thu Mar 24 14:10:58 2016
@@ -117,7 +117,9 @@ public:
           iterator_category;
   typedef typename std::iterator_traits<RootIt>::difference_type
           difference_type;
-  typedef typename UnaryFunc::result_type value_type;
+  typedef typename std::result_of<
+            UnaryFunc(decltype(*std::declval<RootIt>()))>
+          ::type value_type;
 
   typedef void pointer;
   //typedef typename UnaryFunc::result_type *pointer;




More information about the llvm-commits mailing list