[bug] typo in type_with_alignment.hpp
template<std::size_t TAlign, std::size_t Align> struct is_aligned { BOOST_STATIC_CONSTANT(bool, value = (TAlign >= Align) & (TAlign % Align == 0) ^^^ <<---- here! ); }; Should it be "&&" instead of "&"?
template<std::size_t TAlign, std::size_t Align> struct is_aligned { BOOST_STATIC_CONSTANT(bool, value = (TAlign >= Align) & (TAlign % Align == 0) ^^^ <<---- here! ); };
Should it be "&&" instead of "&"?
Logically yes: however when you think about it, it actually makes no practical difference, and I believe it was done that way deliberately as a workaround for certain broken compilers that choke on logical expressions "&&" inside integral constant expressions. So for now I'm going to leave it alone. John.
John Maddock wrote:
template<std::size_t TAlign, std::size_t Align> struct is_aligned { BOOST_STATIC_CONSTANT(bool, value = (TAlign >= Align) & (TAlign % Align == 0) ^^^ <<---- here! ); };
Should it be "&&" instead of "&"?
Logically yes: however when you think about it, it actually makes no practical difference, and I believe it was done that way deliberately as a workaround for certain broken compilers that choke on logical expressions "&&" inside integral constant expressions. So for now I'm going to leave it alone.
Perhaps a comment to this effect could be added to the code to show that it is intentional and not an error or oversight. Paul
participants (3)
-
John Maddock -
Paul Giaccone -
pongba