Simple question: How to verify two types are the same?

Hi all... I know this is a simple question, but I can't figure out which
boost function to use. How do I find out if two types are the same type?
For example:
template

Stephen Gross wrote:
Hi all... I know this is a simple question, but I can't figure out which boost function to use. How do I find out if two types are the same type?
For example:
template
void compare() { if(boost::types_are_the_same ::result == true) ... }
Almost. Use boost::is_same

Try boost::is_same
-----Original Message----- From: boost-users-bounces@lists.boost.org [mailto:boost-users- bounces@lists.boost.org] On Behalf Of Stephen Gross Sent: Tuesday, April 12, 2005 2:05 PM To: boost-users@lists.boost.org Subject: [Boost-users] Simple question: How to verify two types are the same?
Hi all... I know this is a simple question, but I can't figure out which boost function to use. How do I find out if two types are the same type?
For example:
template
void compare() { if(boost::types_are_the_same ::result == true) ... } Thanks! --Steve
Stephen Gross Case Western School of Medicine Cleveland, OH
"The large print giveth and the small print taketh away." - Tom Waits
_______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users

This works at compile time.
-----Original Message----- From: boost-users-bounces@lists.boost.org [mailto:boost-users- bounces@lists.boost.org] On Behalf Of Stephen Gross Sent: Tuesday, April 12, 2005 3:11 PM To: boost-users@lists.boost.org Subject: Re: [Boost-users] Simple question: How to verify two types arethesame?
Try boost::is_same
::value I tried this, but I think it works at runtime, not compile time (using typeid(...)). I need to find a compile-time solution...
--Steve
_______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
participants (3)
-
Bruce Trask
-
Fredrik Blomqvist
-
Stephen Gross