stdcxx-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Martin Sebor <se...@roguewave.com>
Subject Re: type_traits progress
Date Tue, 27 May 2008 03:01:53 GMT
I haven't gone through the whole patch yet so just a few brief
comments. I'll follow up with more once I've finished reviewing
the rest.

First, some of your files are missing the final newline (required
of text files by POSIX).

Regarding style: The convention is

     template <class>
     struct S;

rather than

     template <class> struct S;

Regarding Copyrights: the year should be 2008 in all newly written
code, and there's a missing ", Inc." at the end.

Regarding naming:

  *  File names should be abbreviated so as not to exceed the 14
     character minimum required by POSIX.
  *  Do the trait member (e.g., _C_type, _C_value) need to be
     privatized or would it make more sense to use the required names?

Regarding the supporting infrastructure (config tests and headers):

  *  In etc/config/src/RVALUE_REFERENCE.cpp needs, the _TYPENAME
     macro isn't defined at this stage. Also, I'm not sure why
     the test needs to use templates at all.
  *  In etc/config/src/VARIADIC_TEMPLATES.cpp, shouldn't struct
     pack (the primary template) be defined? Also, is the empty
     specialization of pack valid? Finally, even though it may
     not matter for correctness, the pack specialization should
     probably be defined as a struct rather than class.
  *  In include/rw/_config-msvc.h: Would we have a naming conflict
     with any of our other macros if we dropped the _TT_ bit from
     the type traits macros? (I would prefer to keep the names of
     the macros short and as close to the type traits intrinsics
     as possible).
  *  In include/rw/_defs.h, what is __NATIVE_TYPE_TRAITS_SUPPORTED
     and where does it come from? I'm also concerned that the macro
     might be #defined but not all the traits might be supported or
     one of them might be spelled differently.

I also noticed that some files (e.g., _is_floating_point.h) make
use of the _RWSTD_SPECIALIZED_CLASS macro while others assume
explicit specialization is supported. I suspect we might as well
assume it is and do away with the macro. Ditto for _TYPENAME.

Martin

Travis Vitek wrote:
> I've posted what I've got for the current type_traits implementation to
> STDCXX-916. I would have just mailed the file to the list directly, but
> it is pretty big.
> 
>     http://issues.apache.org/jira/browse/STDCXX-916
> 
> The tests do compile and run on VC8. There are still a few failures. I'm
> in the process of porting this to linux/gcc4.3 and I'm expecting the
> results to be a bit better there because all of the necessary compiler
> support is available.
> 
> Please review the code and provide feedback. It would be most helpful if
> any comments are pasted along with the block of code in question.
> 
> Also, please don't focus on formatting to much. I know that I have a few
> lines that run over 76 characters wide and that I've left out some
> spaces after commas and before open parens. I'll deal with that stuff on
> my own.
> 
> Note that some of the tests have type names that end in underscores.
> I'll be changing these to end in _t. It makes things more readable.
> 
> Travis


Mime
View raw message