This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] C++2a Utility functions to implement uses-allocator construction (P0591R4)


On 01/03/19 14:06 +0000, Jonathan Wakely wrote:
+	  if constexpr (sizeof...(__args) == 0)
+	    {
+	      return std::make_tuple(piecewise_construct,
+		  std::__uses_alloc_args<_Tp1>(__a),
+		  std::__uses_alloc_args<_Tp2>(__a));
+	    }
+	  else if constexpr (sizeof...(__args) == 1)
+	    {

If we want to ensure we only accept std::pair and not other pair-like
types, then this branch would need:

             static_assert((__is_pair<_Args>::value && ...));

+	      return std::make_tuple(piecewise_construct,
+		  std::__uses_alloc_args<_Tp1>(__a,
+		    std::forward<_Args>(__args).first...),
+		  std::__uses_alloc_args<_Tp2>(__a,
+		    std::forward<_Args>(__args).second...));
+	    }
+	  else if constexpr (sizeof...(__args) == 2)


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]