|
Boost : |
From: Jeremy Siek (jsiek_at_[hidden])
Date: 2002-02-21 23:40:21
The BOOST_CLASS_REQUIRES macro doesn't work with VS.Net. As a workaround
you'll have to use function_requires instead.
I'd create another class, put functions_requires in its default
constructor, and then have Test inherit from it.
Cheers,
Jeremy
On Thu, 21 Feb 2002, David Brownell wrote:
david_> I am playing around with the Concept Check classes, and
david_> trying to get the following code to compile. All I want
david_> to check is if the type is a std::vector and contains
david_> unsigned chars. What am I doing wrong? I am trying to
david_> compile on VS.Net.
david_>
david_> Thanks in advance for your help!
david_> David Brownell
david_>
david_> #include<vector>
david_> #include "boost\concept_check.hpp"
david_>
david_> template <class OutputVector = std::vector<unsigned char> >
david_> class Test
david_> {
david_> BOOST_CLASS_REQUIRES(OutputVector,
david_> boost::ConvertibleConcept<OutputVector::value_type, unsigned char>);
david_> BOOST_CLASS_REQUIRES(OutputVector,
david_> boost::RandomAccessContainerConcept<OutputVector>);
david_> };
david_>
david_> int main(void)
david_> {
david_> Test t<>;
david_> return(true);
david_> }
david_>
david_> Info: http://www.boost.org Send unsubscribe requests to: <mailto:boost-unsubscribe_at_[hidden]>
david_>
david_> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
david_>
david_>
----------------------------------------------------------------------
Jeremy Siek http://php.indiana.edu/~jsiek/
Ph.D. Student, Indiana Univ. B'ton email: jsiek_at_[hidden]
C++ Booster (http://www.boost.org) office phone: (812) 855-3608
----------------------------------------------------------------------
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk