Re: [Type Traits] is_array and remove_bounds bug

"John Maddock" <john@johnmaddock.co.uk> wrote in message news:005801c3e27a$a6c4d1f0$4b580352@fuji...
I have noticed that is_array and remove_bounds do not seem to work with array types of unknown bounds; e.g.,
BOOST_STATIC_ASSERT(!boost::is_array< int[] >::value); BOOST_STATIC_ASSERT((boost::is_same< boost::remove_bounds< int[]
::type, int[]>::value));
compile on GCC 3.2 and VC7.1. Is this the desired behavior?
No, not at all.
Thanks for the patches,
No trouble.
... this seems to be a strange corner case: VC7.1 doesn't need the patches (it does the right thing without them), but gcc does, while Borland doesn't compile the patched version, or do the right thing without the patches... sigh.
That's funny. My installation of VC7.1 defintely doesn't work with the unpatched version.
Anyway, I've patched the headers and extended the test cases on my
local cvs
copy, I've got the type traits regression tests running now, assuming everything is OK, then I'll commit your patches when cvs comes back online.
How did the regressions turn out? BTW, while we're on the subject of remove_bounds, I think the documentation is slightly misleading. All the remove_xxx traits have a note under 'compiler requirements' essentially stating that the traits don't work correctly without partial specialization, 'except as noted below'. AFAICT, the note refers to the use of the macro BOOST_BROKEN_COMPILER_TYPE_TRAITS_SPECIALIZATION; however, this macro does not provide specializations of remove_bounds (and probably can't, efficiently). I therefore think it might be appropriate to remove 'except as noted below' from the remove_bounds documentation. I am I wrong? Thanks. Jonathan

How did the regressions turn out?
All OK apart from gcc 3.4, pre-release. I'll report that one as a bug/regression to the gcc guys, and hopefully they'll fix it before the compiler goes out for release.
BTW, while we're on the subject of remove_bounds, I think the documentation is slightly misleading. All the remove_xxx traits have a note under 'compiler requirements' essentially stating that the traits don't work correctly without partial specialization, 'except as noted below'. AFAICT, the note refers to the use of the macro BOOST_BROKEN_COMPILER_TYPE_TRAITS_SPECIALIZATION; however, this macro does not provide specializations of remove_bounds (and probably can't, efficiently). I therefore think it might be appropriate to remove 'except as noted below' from the remove_bounds documentation. I am I wrong?
No, I'll fix that as well. Thanks, John.
participants (2)
-
John Maddock
-
Jonathan Turkanis