This file is part of the <ext/Preprocessor> library API, and can be directly included by user programs.
ext/ | This file is part of the <ext/Preprocessor> library API, and can be directly included by user programs. |
License | Copyright © 2007-2011, FreeBASIC Extended Library Development Group Copyright © 2002, Paul Mensonides |
Macros | |
fbextPP_SeqFirstN | expands to a sequence of the first n number of elements of the sequence seq. |
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
# define fbextPP_SeqFirstN( n, seq ) FBEXT_PP_SEQ_FOLDLEFT( fbextPP_SeqFirstN__M, FBEXT_PP_EMPTY(), FBEXT_PP_CAT(fbextPP_TupleElem__2__0, FBEXT_PP_SEQ_SPLIT(n, seq(__))) )
expands to a sequence of the first n number of elements of the sequence seq.
# include "ext/preprocessor/seq/firstn.bi" # include "ext/preprocessor/stringize.bi" # define SEQ (a)(b)(c)(d) ' Expands to "(a)(b)(c)" # print FBEXT_PP_STRINGIZE(fbextPP_SeqFirstN(3, SEQ))
expands to a sequence of the first n number of elements of the sequence seq.
# define fbextPP_SeqFirstN( n, seq ) FBEXT_PP_SEQ_FOLDLEFT( fbextPP_SeqFirstN__M, FBEXT_PP_EMPTY(), FBEXT_PP_CAT(fbextPP_TupleElem__2__0, FBEXT_PP_SEQ_SPLIT(n, seq(__))) )