Boost logo

Boost :

From: David Abrahams (david.abrahams_at_[hidden])
Date: 2002-02-21 16:18:20


In my use of type_traits, I've frequently wanted to be able to turn boolean
values into tags for tag dispatching, e.g.:

    return dispatch_function(&x, boost::is_const<X>::type());

As it stands, I can write:

    template <bool> struct bool_t {};
    return dispatch_function(&x, bool_t<boost::is_const<X>::value>());

But, it's a little cumbersome, and nearly all of type_traits ICEs are
expressed in terms of yes_type and no_type anyway. Any chance of
institutionalizing this and making it public?

-Dave

+---------------------------------------------------------------+
                  David Abrahams
      C++ Booster (http://www.boost.org) O__ ==
      Pythonista (http://www.python.org) c/ /'_ ==
  resume: http://users.rcn.com/abrahams/resume.html (*) \(*) ==
          email: david.abrahams_at_[hidden]
+---------------------------------------------------------------+


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk