
I am working on some generic code that could use a method deduction trick of some sort. One mentioned by J.Maddock (http://lists.boost.org/MailArchives/boost/msg52178.php) does not work on vc6 - is there anything in boost (MPL?) that can help? Thanks, Max. This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail.

I am working on some generic code that could use a method deduction
"Max Khesin" <MKhesin@liquidnet.com> wrote in message news:4B6FB7F60D37D41188C300B0D022E0C003050A12@exchange.lnholdings.com... trick of
I wouldn't count on any member detection with VC6. I little works with V7.0. What problem are you trying to solve? Jonathan

"Jonathan Turkanis" <technews@kangaroologic.com> writes:
You can detect type members on vc6. See mpl/aux_/has_xxx.hpp.
-- Dave Abrahams Boost Consulting http://www.boost-consulting.com

"David Abrahams" <dave@boost-consulting.com> wrote in message news:upt6z5s2f.fsf@boost-consulting.com...
"Jonathan Turkanis" <technews@kangaroologic.com> writes:
I'm familiar with the implementation of has_xxx, but I was pretty sure it didn't work on VC6 .... In fact, the test program at the end of this message compiles fine on VC6, but should static assert if has_xxx is supported. Am I doing something wrong? By the way, I have an implementation of has_template_xxx, which detects member templates. It works on all my SFINAE-capable compilers -- seven, at last count -- but I'm afraid it's probably not standard-conforming. Any interest? Jonathan -------------------------------------------------------------------- #include <boost/mpl/aux_/has_xxx.hpp> #include <boost/static_assert.hpp> struct S { }; struct T { typedef int kids; }; BOOST_MPL_HAS_XXX_TRAIT_NAMED_DEF(has_kids, kids, true) int main() { BOOST_STATIC_ASSERT(has_kids<S>::value); // Should fail. BOOST_STATIC_ASSERT(has_kids<T>::value); }

Jonathan Turkanis writes:
Among other things, "has_xxx.hpp" contains MSVC 6.0-specific implementation.
Yep, please see below.
You don't imply that a conforming implementation is not possible, do you?
Any interest?
After the release, sure. [...]
^ That's a really unfortunate choice of name. One of the MSVC 6.0's peculiar bugs is this: struct T {}; template< typename T > struct her : T {}; // inherits from *global* T!
If you rename 'T' to something else, it will.
BOOST_STATIC_ASSERT(has_kids<T>::value); }
-- Aleksey Gurtovoy MetaCommunications Engineering

"Aleksey Gurtovoy" <agurtovoy@meta-comm.com> wrote in message news:m2iscrx8sk.fsf@meta-comm.com...
not
standard-conforming.
You don't imply that a conforming implementation is not possible, do you?
No. But I'm not sure my technique is conforming. At first I thought I could interpret 14.8.2/2 to allow it, but now I think the interpretation is a bit iffy. Anyway, that's why I never posted it.
Hah! I guess I must have used the same name when I tested it before. Better stick to 'Thing'. Since I couldn't get it to work on VC6 I thought the MSVC workaround must be just for 7.0. So Borland 5.x is really the odd man out here. Jonathan
participants (4)
-
Aleksey Gurtovoy
-
David Abrahams
-
Jonathan Turkanis
-
Max Khesin