Skip to content

Commit 9d6b871

Browse files
committed
Work around GCC 4.x constexpr failure in operator[]
1 parent 79ca787 commit 9d6b871

1 file changed

Lines changed: 6 additions & 5 deletions

File tree

include/boost/array.hpp

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,8 @@
3131
#ifndef BOOST_ARRAY_HPP
3232
#define BOOST_ARRAY_HPP
3333

34-
#include <boost/detail/workaround.hpp>
34+
#include <boost/config.hpp>
35+
#include <boost/config/workaround.hpp>
3536

3637
#if BOOST_WORKAROUND(BOOST_MSVC, >= 1400)
3738
# pragma warning(push)
@@ -50,9 +51,6 @@
5051
#include <boost/throw_exception.hpp>
5152
#include <algorithm>
5253

53-
// FIXES for broken compilers
54-
#include <boost/config.hpp>
55-
5654

5755
namespace boost {
5856

@@ -117,7 +115,10 @@ namespace boost {
117115
return BOOST_ASSERT_MSG( i < N, "out of range" ), elems[i];
118116
}
119117

120-
BOOST_CONSTEXPR const_reference operator[](size_type i) const
118+
#if !BOOST_WORKAROUND(BOOST_GCC, < 50000)
119+
BOOST_CONSTEXPR
120+
#endif
121+
const_reference operator[](size_type i) const
121122
{
122123
return BOOST_ASSERT_MSG( i < N, "out of range" ), elems[i];
123124
}

0 commit comments

Comments
 (0)