ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> boost
boost
[boost] [type traits] is_class, is_enum, test dependencies
by David Abrahams other posts by this author
Oct 3 2003 3:42PM messages near this date
[boost] Re: shifted_ptr review results | Re: [boost] [type traits] is_class, is_enum, test dependencies
I was pretty sure I posted something about this, but can't find it,
so...

Yesterday I checked in some changes to is_enum which allow it to work
for a new case on a variety of compilers (everything which supports
SFINAE, plus VC7):

  struct convertible_to_anything
  {
      template<typename T>  operator T() { return 0; }
  };


  TT_TEST_BEGIN(is_enum)

  BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_enum<convertible_to_anything> ::value, false);

  TT_TEST_END

This case has been checked in as tricky_enum_test.cpp.

In the process, I made a few trivial changes which allow EDG compilers
to use the "conforming" is_class implementation.  It was as simple as
introducing a few specializations to strip cv-qualification from the
argument.

I note that this was needed in order to pass the is_class tests
because they expect is_class<SomeClass const> ::value to be true.  We
don't have similar tests for is_enum.  

  a. Should we?  

  b. Regardless, is it documented somewhere that const-ness is
     irrelevant to class-ness as far as the traits are concerned?
     Obviously if a == yes, then we need the same for is_enum.

Note also, the is_enum implementation needed a subset of the
is_class_impl functionality, which was duplicated instead of reusing
is_class, in part because it would have kept the is_enum change from
working with vc7.  Also, though, is_enum didn't need the elimination
of unions performed by is_class.  Some refactoring may be in order here.

-- 
Dave Abrahams
Boost Consulting
www.boost-consulting.com

_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
Thread:
David Abrahams
John Maddock

Privacy Policy | Email Opt-out | Feedback | Syndication
© ActiveState Software Inc. All rights reserved