Boost logo

Boost Users :

From: Doug Gregor (dgregor_at_[hidden])
Date: 2007-04-02 08:48:50


On Apr 2, 2007, at 7:20 AM, Benjamin Lau wrote:

>
> I'm writing a template class and I have several requirements on the
> type parameters. A lot of it has to do with the inter-convertibility
> of the types. I have 2 options to choose from as to how I can check
> for these convertibility requirements: static assertions with the type
> traits selector is_convertible, or using concept_check to check if the
> assignment operation is defined for the types. Even though the former
> leads to shorter code, the latter works just as well as I already have
> concepts modeled for these types, so I could just dump the
> inter-convertibility checks inside as well without much hassle.

If you already have the concepts for these types, then I would
suggest sticking with just the concept check library.
BOOST_STATIC_ASSERT is good for simple checks, but its use doesn't
really scale to non-trivial concepts.

        Cheers,
        Doug


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net