Boost logo

Boost :

Subject: [boost] [preprocessor] missing IS_EMPTY documentation?
From: Lorenzo Caminiti (lorcaminiti_at_[hidden])
Date: 2010-09-03 11:29:41


Hello all,

Is there a reason why `BOOST_PP_IS_EMPTY()` is not part of
Boost.Preprocessor reference documentation?

1) I think this macro is part of the library public API because it is
in <boost/preprocessor/facilities/is_empty.hpp> (outside the "detail/"
directory and same location as `BOOST_PP_EMPTY` which is documented).

2) Is it OK to use `PP_IS_EMPTY()` to check if a macro expansion is
actually empty or not? For example:

    #include <boost/preprocessor/facilities/empty.hpp>
    #include <boost/preprocessor/facilities/is_empty.hpp>

    #define X /* expand to nothing */
    #define Y BOOST_PP_EMPTY
    #define Z a b c BOOST_PP_EMPTY

    BOOST_PP_IS_EMPTY(X) // expand to 1
    BOOST_PP_IS_EMPTY(Y()) // expand to 1
    BOOST_PP_IS_EMPTY(Y) // expand to 0
    BOOST_PP_IS_EMPTY(Z()) // expand to 0

Thank you for the clarification.

-- 
Lorenzo

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