ext/ preprocessor/ seq/ foreachi.bi

This file is part of the <ext/Preprocessor> library API, and can be directly included by user programs.

Summary
ext/ preprocessor/ seq/ foreachi.biThis file is part of the <ext/Preprocessor> library API, and can be directly included by user programs.
LicenseCopyright © 2009, FreeBASIC Extended Library Development Group Copyright © 2002, Paul Mensonides
Macros
fbextPP_SeqForEachIExpands a macro for every element in a sequence.

License

Copyright © 2009, FreeBASIC Extended Library Development Group Copyright © 2002, Paul Mensonides

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

Distributed under the FreeBASIC Extended Library Group license.  See accompanying file LICENSE.txt or copy at http://code.google.com- /p- /fb-extended-lib- /wiki- /License

Macros

fbextPP_SeqForEachI

# define fbextPP_SeqForEachI(
   m,
   data,
   seq
) FBEXT_PP_REPEAT(FBEXT_PP_SEQ_SIZE(seq), fbextPP_SeqForEachI__M, (m)(data)(seq))

Expands a macro for every element in a sequence.

Parameters

mA user-defined macro that is called for every element in the sequence.  It has the form m(data, i, elem), where data is auxilliary data passed to fbextPP_SeqForEachI, i is the zero-based position of the current element, and elem is the current element.
dataAuxilliary data that is passed to the user-defined macro.
seqA sequence.

Returns

User-defined.

Description

Given a sequence (a)(b)(c)(d), this macro expands to m(data, 0, a) m(data, 1, b) m(data, 2, c) m(data, 3, d).

# define fbextPP_SeqForEachI(
   m,
   data,
   seq
) FBEXT_PP_REPEAT(FBEXT_PP_SEQ_SIZE(seq), fbextPP_SeqForEachI__M, (m)(data)(seq))
Expands a macro for every element in a sequence.