ext/ preprocessor/ tuple/ foreach.bi

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

Summary
ext/ preprocessor/ tuple/ foreach.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_TupleForEachrepeatedly expands the user-defined macro m, passing it, in order, each element stored in the tuple tuple of size size.

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_TupleForEach

# define fbextPP_TupleForEach(
   size,
   tuple,
   m
) _fbextPP_TupleForEach__##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.

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

# define M(elem) [elem]

then this macro expands to `[a] [b] [c]`.

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_TupleForEach(
   size,
   tuple,
   m
) _fbextPP_TupleForEach__##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.