Re: [Boost-users] Boost-users Digest, Vol 3359, Issue 1

On 2/14/2013 2:26 AM, boost-users-request-at-lists.boost.org |Boost/Allow to home| wrote:
Message: 5 Date: Wed, 13 Feb 2013 19:20:40 -0500 From: Edward Diener
To:boost-users@lists.boost.org Subject: Re: [Boost-users] [Preprocessor] Generate #include directive with preprocessor Message-ID: Content-Type: text/plain; charset=ISO-8859-1; format=flowed On 2/13/2013 6:43 AM, Adam Badura wrote:
Is it possible to use preprocessor to generate #include directives (or in any other way include the files)? No it is not possible. You cannot define a macro which expands to other another macro definition or any other basic preprocessor construct, including the #include.
It is possible to use a macro as the name of the file to include. So you can choose the file via preprocessing logic, but not alter the fact that some file is to be included. So... given an empty file and a file with #include M1 #include M2 you can use recursion to include an arbitrary number of different files based on preprocessor logic. --John
participants (1)
-
John M. Dlugosz