The BOOST_PP_MIN_D macro expands to the lesser of its second and third arguments.  It reenters BOOST_PP_WHILE with maximum efficiency.

Usage

BOOST_PP_MIN_D(d, x, y)

Arguments

d
The next available BOOST_PP_WHILE iteration. 
x
The first operand.  Valid values range from 0 to BOOST_PP_LIMIT_MAG.
y
The second operand.  Valid values range from 0 to BOOST_PP_LIMIT_MAG.

Remarks

This macro returns the lesser of its first and second arguments or the value of both arguments if they are equal.

See Also

Requirements

Header:  <boost/preprocessor/selection/min.hpp>

Sample Code

#include <boost/preprocessor/list/fold_left.hpp>
#include <boost/preprocessor/selection/min.hpp>

#define LIST (1, (3, (5, (2, (4, BOOST_PP_NIL)))))

#define OP(d, state, x) BOOST_PP_MIN_D(d, state, x)

#define LIST_MAX(list) BOOST_PP_LIST_FOLD_LEFT(OP, 20, LIST)

LIST_MIN(LIST) // expands to 1

Copyright Housemarque Oy 2002
Copyright Paul Mensonides 2002

Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at www.boost.org/LICENSE_1_0.txt)