Boost logo

Boost :

From: Gennaro Prota (gennaro_prota_at_[hidden])
Date: 2004-05-16 04:40:32


Hi,

I was grep'ing for my name in the boost repository in order to update
any old license reference and found the following definition in
implicit_cast.hpp:

// Macro for when you need a constant expression (Gennaro Prota)
#define BOOST_IMPLICIT_CAST(dst_type, expr) \
          ( sizeof( implicit_cast<dst_type>(expr) ) \
                     , \
            static_cast<dst_type>(expr) \
          )

This wasn't the form I submitted though, as the comma operator isn't
allowed in a constant expression and I remember pointing out on this
list that this was a case where it would be useful :) Maybe the above
was simply copied from this post:

  http://lists.boost.org/MailArchives/boost/msg42102.php

where I was saying that it *doesn't* work and that I had to use the
check_helper<> template.

Genny.


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