[boost.preprocessor.iteration] relative file iteration not supported
Hello, I have used Boost in the past and do like the use of the preprocessor as a way of making repetitious code. However, I found that in a project that I was working on, I needed the ability to iterate over a file relative to the file I was iterating from, and that file wasn't relative to any of the include directories. I thought about this and it makes sense to why it didn't work, but I can see that it can prove to be inconvenient sometimes when someone wishes to make library header files relative to each other to allow for flexible positioning of the related files in the source tree or not have to add new items to the include directory set. I have written a preprocessor library to fill this need, but was wondering if such a library would be of interest to the Boost community. I deliberately tweaked it to be similar to the Boost Preprocessor Iterator library, and can be acquired at https://sourceforge.net/projects/relativeiterate/, including documentation and an example located in the README.txt file. I would appreciate any feedback you may have on this and would be more than willing to make changes to accommodate what would be needed for it to be included into the Boost set. Thank you for your time. Adrian -- ======================================== Adrian Hawryluk BSc. Computer Science ---------------------------------------- Specialising in: OOD Methodologies in UML OOP Methodologies in C, C++ and more RT Embedded Programming GUI Development ========================================
On 5/2/2013 10:51 PM, Adrian H wrote:
I would appreciate any feedback you may have on this and would be more than willing to make changes to accommodate what would be needed for it to be included into the Boost set.
How do you force relative lookup? I.e. only some preprocessors do relative lookup, and the standard does not say anything about it. -Paul
Paul Mensonides wrote
I would appreciate any feedback you may have on this and would be more than willing to make changes to accommodate what would be needed for it to be included into the Boost set.
How do you force relative lookup? I.e. only some preprocessors do relative lookup, and the standard does not say anything about it.
Hi Paul, Having some problems with this mailing list. I'm getting emails from it, but my messages and your response didn't show. So googled my subject line and found my thread here on nabble. Odd. Anyway, in response to your message. It is all in the README file. I didn't look at the implementation of BOOST_PP_ITERATE() when I wrote it initially, but after the fact, when I documented it, it turns out that I broke it up into 3 sections: 1. REL_ITERATE_INIT() which initialises the defines for the loop to work 2. REL_ITERATE_NEXT() which increments/decrements the REL_ITERATION() value(s), and 3. REL_ITEREATE() which actually reincludes the file, or doesn't if there is no more iterations left. For more information, please look at the README. If there is something there that you have questions about, please feel free to ask. Adrian -- View this message in context: http://boost.2283326.n4.nabble.com/boost-preprocessor-iteration-relative-fil... Sent from the Boost - Dev mailing list archive at Nabble.com.
Oh, seems I didn't quite answer the question. It is because of #3 that relative inclusion is possible. Since inclusion is not done from within an included file in another directory, it can be made relative to the current file. Adrian -- View this message in context: http://boost.2283326.n4.nabble.com/boost-preprocessor-iteration-relative-fil... Sent from the Boost - Dev mailing list archive at Nabble.com.
I'm looks like misunderstood the boost discussion policy. After reading some posts, I've determined that this is the correct subject line and am reposting my message in case filters are in place which would prevent my post from getting to those who are interested. I apologize in advance for any inconvenience. Repost follows: Hello, I have used Boost in the past and do like the use of the preprocessor as a way of making repetitious code. However, I found that in a project that I was working on, I needed the ability to iterate over a file relative to the file I was iterating from, and that file wasn't relative to any of the include directories. I thought about this and it makes sense to why it didn't work, but I can see that it can prove to be inconvenient sometimes when someone wishes to make library header files relative to each other to allow for flexible positioning of the related files in the source tree or not have to add new items to the include directory set. I have written a preprocessor library to fill this need, but was wondering if such a library would be of interest to the Boost community. I deliberately tweaked it to be similar to the Boost Preprocessor Iterator library, and can be acquired at https://sourceforge.net/projects/relativeiterate/, including documentation and an example located in the README.txt file. I would appreciate any feedback you may have on this and would be more than willing to make changes to accommodate what would be needed for it to be included into the Boost set. Thank you for your time. Adrian -- ======================================== Adrian Hawryluk BSc. Computer Science ---------------------------------------- Specialising in: OOD Methodologies in UML OOP Methodologies in C, C++ and more RT Embedded Programming GUI Development ========================================
participants (3)
-
Adrian H
-
Adrian_H
-
Paul Mensonides