Boost logo

Boost :

From: Alisdair Meredith (alisdair.meredith_at_[hidden])
Date: 2003-02-07 17:58:57


I have a potential patch for the boost::array tests that will pass under
Borland 0x561 and probably under MSVC as well [I think it is the same
issue]

I am leary of resolving an issue by patching a test, but I think the
issue is comparatively minor, especially in regard to most library use,
and currently failing 40% of tests does not accurately reflect the case
either.

The problem is that borland (and likely MS) cannot use initialiser
syntax for aggregates that are in turn made up of non-aggregate types.
The failing tests (3 & 4) uses arrays of std::strings. Switching to
const char * on the broken compiler 'resolves' the issue.

Hence the proposed patch: [from CVS diff logs]

cvs diff array3.cpp (in directory
C:\Projects\3rdParty\boost\libs\array\)
Index: array3.cpp
===================================================================
RCS file: /cvsroot/boost/boost/libs/array/array3.cpp,v
retrieving revision 1.5
diff -r1.5 array3.cpp
12a13,20
> #if defined( BOOST_AGGREGATES_INITIALISE_ONLY_PODS )
> typedef const char * season_type;
> #else
> typedef std::string season_type;
> #endif
>
> typedef boost::array<season_type,4> seasons_array;
>
19c27
< boost::array<std::string,4> seasons = {

---
>     seasons_array seasons = {
24c32
<     boost::array<std::string,4> seasons_orig = seasons;
---
>     seasons_array seasons_orig = seasons;
39c47
<     for (boost::array<std::string,4>::reverse_iterator pos
---
>     for (seasons_array::reverse_iterator pos
56d63
< 
===================================================================
and
===================================================================
RCS file: /cvsroot/boost/boost/libs/array/array4.cpp,v
retrieving revision 1.4
diff -r1.4 array4.cpp
14a15,23
> #if defined( BOOST_AGGREGATES_INITIALISE_ONLY_PODS )
> typedef const char * season_type;
> #else
> typedef std::string season_type;
> #endif
> 
> typedef boost::array<season_type,4> seasons_array;
> 
> 
18c27
<     boost::array<boost::array<std::string,4>,2> seasons_i18n = {
---
>     boost::array<seasons_array,2> seasons_i18n = {
26c35
<         boost::array<std::string,4> seasons = seasons_i18n[i];
---
>         seasons_array seasons = seasons_i18n[i];
BOOST_AGGREGATES_INITIALISE_ONLY_PODS would (obviously!) be defined in
config for each affected compiler, known to be Borland up to 0x0561,
MSVC6 and MSVC7.
-- 
AlisdairM

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk