
I am only set up for testing with Borland compilers at the moment, and the test results aren't visible at the moment, but ... I am looking into two test cases, buffer.cpp and buffer_select.cpp. Both fail for the same reason - an attempt to instantiate array< const char, 1024 >. That looks like a genuine error to me, array does not support const PODs, instead you must declare a const array. However, I have not tracked down the source of this instantiation yet, so it might be a bad type deduction by the compiler as well. Any hints on where to look more closely appreciated. -- AlisdairM

Hi Alisdair, On Sun, 28 Jan 2007 23:12:10 +0000 (UTC), "AlisdairM" <alisdair.meredith@uk.renaultf1.com> said:
I am only set up for testing with Borland compilers at the moment, and the test results aren't visible at the moment, but ...
I am looking into two test cases, buffer.cpp and buffer_select.cpp. Both fail for the same reason - an attempt to instantiate array< const char, 1024 >. That looks like a genuine error to me, array does not support const PODs, instead you must declare a const array.
It doesn't? I was under the impression that array<T> only required that T be CopyConstructible, unlike vector<T> which also requires T be Assignable.
However, I have not tracked down the source of this instantiation yet, so it might be a bad type deduction by the compiler as well.
Any hints on where to look more closely appreciated.
Search for BOOST_WORKAROUND in boost/asio/buffer.hpp. I assume you're using BDS2006 -- I only have access to BCB6. What's the correct value of __BORLANDC__ for the newer compiler? Thanks for testing this out! Cheers, Chris

Christopher Kohlhoff wrote:
It doesn't? I was under the impression that array<T> only required that T be CopyConstructible, unlike vector<T> which also requires T be Assignable.
The basic problem is that the following is not legal C++: strict bad { const int x; }; If a class contains const non-static members, they must have a user-declared default constructor, so this basically rules out PODs or any type with trivial default constructor. It is annoying, because even though 'bad' looks safe to use with aggregate initialization, it is not allowed.
Search for BOOST_WORKAROUND in boost/asio/buffer.hpp. I assume you're using BDS2006 -- I only have access to BCB6. What's the correct value of BORLANDC for the newer compiler?
Current compiler is version 0x582, when patched. It is probably not worth worrying about unpatched versions. -- AlisdairM

Hi Alisdair, On Mon, 29 Jan 2007 07:56:12 +0000 (UTC), "AlisdairM" <alisdair.meredith@uk.renaultf1.com> said:
Christopher Kohlhoff wrote:
It doesn't? I was under the impression that array<T> only required that T be CopyConstructible, unlike vector<T> which also requires T be Assignable.
The basic problem is that the following is not legal C++:
strict bad { const int x; };
If a class contains const non-static members, they must have a user-declared default constructor, so this basically rules out PODs or any type with trivial default constructor.
It is annoying, because even though 'bad' looks safe to use with aggregate initialization, it is not allowed.
Hmmm, weird. Do you happen to have the relevant section number in the standard handy? Cheers, Chris

Christopher Kohlhoff wrote:
Hmmm, weird. Do you happen to have the relevant section number in the standard handy?
OK, I've been chasing this down and it seems the mistake is mine <g> long-winded excuse: a while back I used a struct with a const int member as an example for one of my hobby-horse issues that the C++ language needed simplifying, until it was pointed out to me this was not legal. I sat and started at the standard long enough to convince myself that this person was right, and verified it with the Comeau online compiler. I repeated both experiments this weekemd, but only get a warning from Comeau, and the parts of the standard that ban this usage all apply in certain contexts (such as when used as a base class) So I withdraw my objection, and will file another bug report with Borland. Thanks. -- AlisdairM

On Sun, 4 Feb 2007 07:13:45 +0000 (UTC), "AlisdairM" <alisdair.meredith@uk.renaultf1.com> said: [...]
So I withdraw my objection, and will file another bug report with Borland.
Great news. I've already committed the change to update the test for __BORLANDC__ as 0x582. There are some other instances of BOOST_WORKAROUND for the Borland compiler, so we'll want to keep an eye on them too. Thanks again. Cheers, Chris
participants (2)
-
AlisdairM
-
Christopher Kohlhoff