Boost logo

Boost Users :

Subject: [Boost-users] [preprocessor]how to compute include with .hpp in name?
From: Larry Evans (cppljevans_at_[hidden])
Date: 2017-01-28 15:31:14


With the attached, I get the error:

g++ computed_include.hpp.cpp -o a.out
In file included from computed_include.hpp.cpp:4:0:
computed_include.hpp.cpp:5:22: error: pasting "computed_include" and "."
does not give a valid preprocessing token
  #define FILENAME_INC computed_include
                       ^
computed_include.hpp.cpp:7:58: note: in expansion of macro ‘FILENAME_INC’
  #define FILENAME_CAT_STR
BOOST_PP_STRINGIZE(BOOST_PP_CAT(FILENAME_INC,HPP_EXT))
                                                           ^
computed_include.hpp.cpp:8:10: note: in expansion of macro
‘FILENAME_CAT_STR’
  #include FILENAME_CAT_STR
           ^

Is there some other way this can be done?

TIA.

-regards,
Larry




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