Boost logo

Boost Users :

From: Server Levent Yilmaz (leventyilmaz_at_[hidden])
Date: 2007-10-03 19:47:51


Hi all,

Please take a look as this trivial example of file iteration:

// trivial.h
#if !BOOST_PP_IS_ITERATING
   #ifndef TRIVIAL_H
   #define TRIVIAL_H
   #include <boost/preprocessor/iteration/iterate.hpp>

   #define BOOST_PP_FILENAME_1 "trivial.h" //!!!
   #define BOOST_PP_ITERATION_LIMITS (1, 3)
   ??=include BOOST_PP_ITERATE()

   #endif // TRIVIAL_H

#else

   BOOST_PP_ITERATION()

#endif

Perhaps not so obvious many (wasn't to me), that

#define BOOST_PP_FILENAME_1 __FILE__

doesn't work. One has to specify (kind of like hardcode) the file's name in
there.. Is there some, possibly contrived, way to achieve automation of
this?

regards,
- Levent

PS: What an AMAZING library this Boost.Preprocessor is!?

-- 
Server Levent Yilmaz
Mechanical Engineering
University of Pittsburgh


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net