Skip to content

Conversation

@sdebionne
Copy link
Contributor

Closes #760

Tasklist

  • Add test case(s)
  • Ensure all CI builds pass
  • Review and approve

@sdebionne sdebionne added cat/bug But reports and bug fixes core/io boost/gil/io labels Apr 4, 2025
Copy link
Member

@mloskot mloskot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@mloskot mloskot merged commit 49d9276 into boostorg:develop Apr 4, 2025
6 of 18 checks passed
@striezel
Copy link
Contributor

striezel commented Apr 4, 2025

Are you sure this is the correct fix? Some of the GCC and Clang builds now fail with errors like

./boost/gil/io/typedefs.hpp:35:51: error: template argument 1 is invalid
   35 | template<> struct is_floating_point<gil::float64_t> : std::true_type {};
      |                                                   ^

or

./boost/gil/io/typedefs.hpp:34:37: error: use of undeclared identifier 'gil'; did you mean 'boost::gil'?
template<> struct is_floating_point<gil::float32_t> : std::true_type {};
                                    ^~~
                                    boost::gil

@sdebionne
Copy link
Contributor Author

This fix might have uncovered other issues 😅 . I'll have a look !

@sdebionne
Copy link
Contributor Author

TBH I did not know that there was an implementation of is_floating_point in Boost.GIL. The file io/typedefs.h include <type_traits> though.

@striezel
Copy link
Contributor

striezel commented Apr 6, 2025

The only place where is_floating_point is used within GIL seems to be the TIFF I/O extension, and there it's only an implementation detail: https://github.com/boostorg/gil/blob/688acf78f7fc4ecb5b1c6f1e4a8f4a5939d28e9b/include/boost/gil/extension/io/tiff/detail/is_allowed.hpp#L101C13-L101C30

Furthermore I'm a bit worried, because cppreference.com states:

If the program adds specializations for std::is_floating_point or std::is_floating_point_v, the behavior is undefined.

Doesn't sound like this is something one should do. As long as those lines were in the boost namespace (before the PR), that was not a specialization of std::is_floating_point but boost::is_floating_point, a different thing - although probably with similar intentions. But with the move to the std namespace it now is a specialization.

@sdebionne
Copy link
Contributor Author

Ok let's revert my fix then and reopen the MR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cat/bug But reports and bug fixes core/io boost/gil/io

Projects

None yet

Development

Successfully merging this pull request may close these issues.

gil lib failed to build due to many errors on Windows with MSVC

4 participants