|
Boost : |
From: v m (boost_vam_at_[hidden])
Date: 2002-10-31 14:48:04
The following is the ConvertibleConcept from
http://www.boost.org/boost/concept_check.hpp
template <class X, class Y>
struct ConvertibleConcept
{
void constraints() {
Y y = x;
ignore_unused_variable_warning(y);
}
X x;
};
----------
Consider the situation where
1. operator Y & (or const Y &) is defined in class X
2. Y is not copy constructible.
In this situation the above test fails, though X is
convertible to Y.
How about using something like:
BOOST_STATIC_ASSERT(boost::is_convertible<X,Y>::value)
?
=====
Vamshi Mugu
North Dakota State University
__________________________________________________
Do you Yahoo!?
HotJobs - Search new jobs daily now
http://hotjobs.yahoo.com/
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk