Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing Boost header in camp/detail/raw_type.hpp #1

Open
fmauger opened this issue May 29, 2020 · 1 comment
Open

Missing Boost header in camp/detail/raw_type.hpp #1

fmauger opened this issue May 29, 2020 · 1 comment

Comments

@fmauger
Copy link

fmauger commented May 29, 2020

The "boost::enable_if" struct is used in file "camp/detail/rawtype.hpp" but there is no proper Boost include. This causes an error while compiling my project with GCC 9.3 (and Boost 1.71) which includes "camp/detail/typeid.hpp"
then "camp/detail/objecttraits.hpp" then "camp/detail/rawtype.hpp".
I wonder why this has not been detected before. Maybe there is some change in the way GCC process templates...
Formerly I was using gcc4.9 and gcc7 with Boost 1.69 and it was ok.

Having a look on some Camp headers, the "#include <boost/utility/enable_if.hpp>" header is often (if not always) included after dependee Camp headers so that, depending on the way we use/include Camp stuff, this issue is not detected if the client code has its own enable_if include somewhere.
I will suggest to include first dependee Boost headers before Camp ones as a general rule... unless someone has a strong argument against this approach.

@fmauger
Copy link
Author

fmauger commented May 29, 2020

If I change the includes' ordering in "camp/detal/typeid.hpp", it compiles again.
Details on my compiler error log:

In file included from /usr/include/camp/detail/objecttraits.hpp:37,
                 from /usr/include/camp/detail/typeid.hpp:37,
                 from my own foo.h
...
/usr/include/camp/detail/rawtype.hpp:100:38: error: ‘enable_if’ in namespace ‘boost’ does not name a template type
  100 | struct RawType, typename boost::enable_if, U> >::type>
      |                                      ^~~~~~~~~
/usr/include/camp/detail/rawtype.hpp:100:47: error: expected template-argument before ‘<’ token
  100 | struct RawType, typename boost::enable_if, U> >::type>
      |                                               ^
/usr/include/camp/detail/rawtype.hpp:100:47: error: expected ‘>’ before ‘<’ token
/usr/include/camp/detail/rawtype.hpp:100:79: error: template argument 2 is invalid
  100 | struct RawType, typename boost::enable_if, U> >::type>
      |                                                                               ^

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant