Discussion:
[Boost-users] [preprocessor]how to compute include with .hpp in name?
Larry Evans
2017-01-28 20:31:14 UTC
Permalink
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

Loading...