Stop relying on mapped_iterator's function having a result_type. That facility
authorRichard Smith <richard-llvm@metafoo.co.uk>
Thu, 24 Mar 2016 19:10:58 +0000 (19:10 +0000)
committerRichard Smith <richard-llvm@metafoo.co.uk>
Thu, 24 Mar 2016 19:10:58 +0000 (19:10 +0000)
is deprecated in modern C++ and unnecessary since decltype can be used to query
the relevant type.

llvm-svn: 264321

llvm/include/llvm/ADT/STLExtras.h

index 28f7594..06a1756 100644 (file)
@@ -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;