forked from boostorg/array
Fix msvc-14.0, gcc-4.x failures
This commit is contained in:
@ -4,10 +4,11 @@
|
|||||||
|
|
||||||
#include <boost/array.hpp>
|
#include <boost/array.hpp>
|
||||||
#include <boost/core/lightweight_test.hpp>
|
#include <boost/core/lightweight_test.hpp>
|
||||||
|
#include <cstddef>
|
||||||
|
|
||||||
template<class T, std::size_t N> void test()
|
template<class T, std::size_t N> void test()
|
||||||
{
|
{
|
||||||
boost::array<T, N> a = {};
|
boost::array<T, N> a = {{}};
|
||||||
|
|
||||||
T (&e)[ N ] = a.elems;
|
T (&e)[ N ] = a.elems;
|
||||||
|
|
||||||
|
@ -4,6 +4,8 @@
|
|||||||
|
|
||||||
#include <boost/array.hpp>
|
#include <boost/array.hpp>
|
||||||
#include <boost/core/lightweight_test.hpp>
|
#include <boost/core/lightweight_test.hpp>
|
||||||
|
#include <boost/config.hpp>
|
||||||
|
#include <boost/config/workaround.hpp>
|
||||||
#include <cstddef>
|
#include <cstddef>
|
||||||
|
|
||||||
template<class T, std::size_t N> void test1()
|
template<class T, std::size_t N> void test1()
|
||||||
@ -57,9 +59,18 @@ int main()
|
|||||||
test2<int, 7>();
|
test2<int, 7>();
|
||||||
|
|
||||||
// test2<int const, 0>();
|
// test2<int const, 0>();
|
||||||
|
|
||||||
|
#if BOOST_WORKAROUND(BOOST_MSVC, < 1910) || BOOST_WORKAROUND(BOOST_GCC, < 50000)
|
||||||
|
|
||||||
|
// = {} doesn't work for const T
|
||||||
|
|
||||||
|
#else
|
||||||
|
|
||||||
test2<int const, 1>();
|
test2<int const, 1>();
|
||||||
test2<int const, 7>();
|
test2<int const, 7>();
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
test3<int>();
|
test3<int>();
|
||||||
test3<int const>();
|
test3<int const>();
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user