ext/preprocessor/tuple/foreachi.bi

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

Summary
ext/preprocessor/tuple/foreachi.biThis file is part of the <ext/Preprocessor> library API, and can be directly included by user programs.
LicenseCopyright © 2007-2011, FreeBASIC Extended Library Development Group Copyright © 2002, Paul Mensonides
Macros
fbextPP_TupleForEachIrepeatedly expands the user-defined macro m, passing it, in order, each element stored in the tuple tuple of size size along with the element’s position in the tuple.

License

Copyright © 2007-2011, 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_TupleForEachI

# define fbextPP_TupleForEachI(
   size,
   tuple,
   m
) _fbextPP_TupleForEachI__##size (m, fbextPP_TupleRemParens(size, tuple))

repeatedly expands the user-defined macro m, passing it, in order, each element stored in the tuple tuple of size size along with the element’s position in the tuple.

For example, if size is `3`, tuple is `(a,b,c)` and m is the name of the macro,

# define M(n, elem) [elem##n]

then this macro expands to `[a0] [b1] [c2]`.

Parameters

sizeis the count of elements in the tuple.
tupleis the tuple which stores the element to retrieve.
mis the name of the user-defined macro to expand.
# define fbextPP_TupleForEachI(
   size,
   tuple,
   m
) _fbextPP_TupleForEachI__##size (m, fbextPP_TupleRemParens(size, tuple))
repeatedly expands the user-defined macro m, passing it, in order, each element stored in the tuple tuple of size size along with the element’s position in the tuple.