Skip to content

Commit

Permalink
Math: fix BitVector inconsistent constexpr
Browse files Browse the repository at this point in the history
  • Loading branch information
sthalik committed Oct 30, 2022
1 parent 5f1e214 commit b7c5a6f
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/Magnum/Math/BitVector.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
#ifndef CORRADE_NO_DEBUG
#include <Corrade/Utility/Debug.h>
#endif
#include <Corrade/Utility/Macros.h>

#include "Magnum/Types.h"
#include "Magnum/Math/Math.h"
Expand Down Expand Up @@ -174,14 +175,14 @@ template<std::size_t size> class BitVector {
* Equivalent to @ref all().
* @see @ref any(), @ref none()
*/
explicit operator bool() const { return all(); }
explicit MAGNUM_CONSTEXPR14 operator bool() const { return all(); }

/**
* @brief Whether all bits are set
*
* @see @ref none(), @ref any(), @ref operator bool()
*/
bool all() const;
MAGNUM_CONSTEXPR14 bool all() const;

/**
* @brief Whether no bits are set
Expand Down Expand Up @@ -361,7 +362,7 @@ template<std::size_t size> inline bool BitVector<size>::operator==(const BitVect
return true;
}

template<std::size_t size> inline bool BitVector<size>::all() const {
template<std::size_t size> MAGNUM_CONSTEXPR14 inline bool BitVector<size>::all() const {
/* Check all full segments */
for(std::size_t i = 0; i != size/8; ++i)
if(_data[i] != FullSegmentMask) return false;
Expand Down

0 comments on commit b7c5a6f

Please sign in to comment.