Skip to content

Commit b32a6cf

Browse files
committed
Work around GCC 5..8 constexpr comparison failures
1 parent 50cf6eb commit b32a6cf

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

include/boost/array.hpp

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -331,6 +331,16 @@ namespace boost {
331331
return true;
332332
}
333333

334+
#if BOOST_WORKAROUND(BOOST_GCC, < 90000)
335+
336+
template<class T>
337+
BOOST_CXX14_CONSTEXPR bool operator== (const array<T, 0>& x, const array<T, 0>& y)
338+
{
339+
return true;
340+
}
341+
342+
#endif
343+
334344
template<class T, std::size_t N>
335345
BOOST_CXX14_CONSTEXPR bool operator!= (const array<T,N>& x, const array<T,N>& y) {
336346
return !(x==y);
@@ -348,6 +358,16 @@ namespace boost {
348358
return false;
349359
}
350360

361+
#if BOOST_WORKAROUND(BOOST_GCC, < 90000)
362+
363+
template<class T>
364+
BOOST_CXX14_CONSTEXPR bool operator< (const array<T, 0>& x, const array<T, 0>& y)
365+
{
366+
return false;
367+
}
368+
369+
#endif
370+
351371
template<class T, std::size_t N>
352372
BOOST_CXX14_CONSTEXPR bool operator> (const array<T,N>& x, const array<T,N>& y) {
353373
return y<x;

0 commit comments

Comments
 (0)