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] Use variadic templates for tr1::is_function



On Apr 10, 2007, at 8:54 AM, Paolo Carlini wrote:
I'm finishing regtesting the below, which I consider better than instantiating a lot of templates for a single trait and/or using something like the old __in_array. Do you agree?

Yes, and your improved version (which removes cv-qualifiers) is the right way to go.


Besides that, I'm a little puzzled by this kind of code in tr1/ functional:

 /**
  * @if maint
  * Retrieve the result type for a function type.
  * @endif
  */
 template<typename _Res, typename... _ArgTypes>
   struct _Weak_result_type_impl<_Res(_ArgTypes...)>
   {
     typedef _Res result_type;
   };

and wanted to quickly double check with you that variadic functions are left out on purpose...

It was an oversight. As you know, just adding the following will fix this error:


template<typename _Res, typename... _ArgTypes>
   struct _Weak_result_type_impl<_Res(_ArgTypes......)>
   {
     typedef _Res result_type;
   };

Sure, you can put a comma between the two ellipses, but it's much more amusing to type six periods in a row :)


	Cheers,
	Doug


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