We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
The following example is a minimal reproduction of this issue:
#define BOOST_TEST_MODULE ExampleTestModule #include <boost/static_assert.hpp> #include <boost/test/included/unit_test.hpp> inline std::ostream& operator<<(std::ostream& os, const std::pair<int, int>& _) { os << "Pairwise operator called!" << std::endl; return os; } BOOST_STATIC_ASSERT(boost::has_left_shift<std::ostream&, const std::pair<int, int>&>::value); // If you comment out the above static assertion, the code compiles and this // test case prints, as expected "Pairwise operator called!" BOOST_AUTO_TEST_CASE(test_case1) { std::pair<int, int> pair; std::cout << pair; }
Compiling with gcc 14.2.1 results in:
ex.cpp:10:87: error: static assertion failed: boost::has_left_shift<std::ostream&, const std::pair<int, int>&>::value 10 | BOOST_STATIC_ASSERT(boost::has_left_shift<std::ostream&, const std::pair<int, int>&>::value);
I have similar results in clang 18.1.6:
ex.cpp:10:21: error: static assertion failed due to requirement 'boost::has_left_shift<std::basic_ostream<char, std::char_traits<char>> &, const std::pair<int, int> &, boost::binary_op_detail::dont_care>::value': boost::has_left_shift<std::ostream&, const std::pair<int, int>&>::value 10 | BOOST_STATIC_ASSERT(boost::has_left_shift<std::ostream&, const std::pair<int, int>&>::value); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/boost/static_assert.hpp:71:55: note: expanded from macro 'BOOST_STATIC_ASSERT' 71 | # define BOOST_STATIC_ASSERT( ... ) static_assert(__VA_ARGS__, #__VA_ARGS__) |
The same happens if you use a std::vector<int> instead.
std::vector<int>
The text was updated successfully, but these errors were encountered:
No branches or pull requests
The following example is a minimal reproduction of this issue:
Compiling with gcc 14.2.1 results in:
I have similar results in clang 18.1.6:
The same happens if you use a
std::vector<int>
instead.The text was updated successfully, but these errors were encountered: