c++boost.gif (8819 bytes)

#include <boost/preprocessor/empty.hpp>


#define BOOST_PP_EMPTY()

Expands to nothing. Used with BOOST_PP_IF() and as an unused parameter.

Example usage as the implementation of BOOST_PP_COMMA_IF(C):

  #define BOOST_PP_COMMA_IF(C)\
    BOOST_PP_IF(C,BOOST_PP_COMMA,BOOST_PP_EMPTY)()

Example usage as an unused macro parameter:

  #define BOOST_PP_DEF(CV)\
    template\
    CV() typename implement_subscript_using_begin_subscript::value_type&\
      implement_subscript_using_begin_subscript::operator[]\
      ( index_type\
          i\
      ) CV()\
    { return base::begin()[i];\
    }

  BOOST_PP_DEF(BOOST_PP_EMPTY)
  BOOST_PP_DEF(const BOOST_PP_EMPTY)
  #undef BOOST_PP_DEF

The above expands to:

  template
  typename implement_subscript_using_begin_subscript::value_type&
    implement_subscript_using_begin_subscript::operator[]
    ( index_type
        i
    )
  { return base::begin()[i];
  }

  template
  const typename implement_subscript_using_begin_subscript::value_type&
    implement_subscript_using_begin_subscript::operator[]
    ( index_type
        i
    ) const
  { return base::begin()[i];
  }

In case you wonder, the above code is part of a generalized layer for implementing the subscripting operators of a random access container.


#define BOOST_PREPROCESSOR_EMPTY()

Obsolete. Use BOOST_PP_EMPTY().


(C) Copyright Housemarque Oy 2002

Permission to copy, use, modify, sell and distribute this document is granted provided this copyright notice appears in all copies. This document is provided "as is" without express or implied warranty, and with no claim as to its suitability for any purpose.

Generated: