Skip to content

Commit

Permalink
Math: add missing CE to BitVector::operator bool()
Browse files Browse the repository at this point in the history
  • Loading branch information
sthalik committed Oct 29, 2022
1 parent 5f1e214 commit 32966a6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 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 CORRADE_CONSTEXPR14 operator bool() const { return all(); }

/**
* @brief Whether all bits are set
*
* @see @ref none(), @ref any(), @ref operator bool()
*/
bool all() const;
CORRADE_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> CORRADE_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
2 changes: 1 addition & 1 deletion src/Magnum/Math/Test/BitVectorTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ void BitVectorTest::convert() {
constexpr BitVector<3> c{a};
CORRADE_COMPARE(c, b);

constexpr BVec3 d(b);
CORRADE_CONSTEXPR14 BVec3 d(b);
CORRADE_COMPARE(d.x, a.x);
CORRADE_COMPARE(d.y, a.y);
CORRADE_COMPARE(d.z, a.z);
Expand Down

0 comments on commit 32966a6

Please sign in to comment.