File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -207,13 +207,13 @@ namespace boost {
207207 typedef std::ptrdiff_t difference_type;
208208
209209 // iterator support
210- iterator begin () BOOST_NOEXCEPT { return iterator ( reinterpret_cast < T * >( this ) ); }
211- const_iterator begin () const BOOST_NOEXCEPT { return const_iterator ( reinterpret_cast < const T * >( this ) ); }
212- const_iterator cbegin () const BOOST_NOEXCEPT { return const_iterator ( reinterpret_cast < const T * >( this ) ); }
210+ BOOST_CXX14_CONSTEXPR iterator begin () BOOST_NOEXCEPT { return data ( ); }
211+ BOOST_CONSTEXPR const_iterator begin () const BOOST_NOEXCEPT { return data ( ); }
212+ BOOST_CONSTEXPR const_iterator cbegin () const BOOST_NOEXCEPT { return data ( ); }
213213
214- iterator end () BOOST_NOEXCEPT { return begin (); }
215- const_iterator end () const BOOST_NOEXCEPT { return begin (); }
216- const_iterator cend () const BOOST_NOEXCEPT { return cbegin (); }
214+ BOOST_CXX14_CONSTEXPR iterator end () BOOST_NOEXCEPT { return begin (); }
215+ BOOST_CONSTEXPR const_iterator end () const BOOST_NOEXCEPT { return begin (); }
216+ BOOST_CONSTEXPR const_iterator cend () const BOOST_NOEXCEPT { return cbegin (); }
217217
218218 // reverse iterator support
219219 typedef std::reverse_iterator<iterator> reverse_iterator;
Original file line number Diff line number Diff line change @@ -44,7 +44,12 @@ void RunTests()
4444 BOOST_TEST ( const_test_case.begin () == const_test_case.end ());
4545 BOOST_TEST ( const_test_case.cbegin () == const_test_case.cend ());
4646
47- BOOST_TEST ( test_case.begin () != const_test_case.begin () );
47+ // BOOST_TEST ( test_case.begin() != const_test_case.begin() );
48+ //
49+ // TR1 specified that begin() must return a unique value for zero-sized
50+ // arrays. However, this makes constexpr unimplementable, and all standard
51+ // libraries have converged on using nullptr instead (see LWG issue 2157.)
52+
4853 if ( test_case.data () == const_test_case.data () ) {
4954 // Value of data is unspecified in TR1, so no requirement this test pass or fail
5055 // However, it must compile!
You can’t perform that action at this time.
0 commit comments