|
Boost : |
From: Gennaro Prota (gennaro_prota_at_[hidden])
Date: 2002-10-01 09:45:49
On Tue, 1 Oct 2002 15:33:19 +0300, "Peter Dimov" <pdimov_at_[hidden]>
wrote:
>From: "Markus Schöpflin" <markus.schoepflin_at_[hidden]>
>[...]
>> So I think we should be ok with
>>
>> #if (defined(_MSC_VER) && (_MSC_VER <= 1300)) // msvc <= 7.0
>> && !defined(__SGI_STL_PORT) && !defined(_STLPORT_VERSION) // no stlport
>> && (
>> (!defined(_CPP_LIB_VER) && defined(_YVALS)) // old dinkumware
>> ||
>> (defined(_CPPLIB_VER) && (_CPPLIB_VER < 306)) // newer dinkumware
>> )
>
>Excuse me for jumping in, but why is the check needed at all? Standard
>allocators must support both forms of allocate().
Well, first of all thanks for jumping in :-) I left this thread
yesterday and this afternoon I have found so much new messages that
now I don't even know who I am... the only message that is clear to me
is yours. Well, don't misunderstand me, that's not an accusation to
others. But I think, sometimes, we post too quickly to the list. Add
the fact that the subject gets very frequently broken and you will
agree that it's very difficult to follow the thread of discussion
sometimes...
As to the main topic, yes, in this case the best solution is just to
call allocate() with two arguments. No #if should have been used.
Anyhow I was also referring to the general case when you *need* to put
in some specific workaround for this or that library. In this case you
may end up with something like above where you test for 5 or 6 macros
just to know what the library is, often duplicating the logic of
select_stdlib_config.hpp (test STLport first, then others...); also
you duplicate some weird tests like
#elif (defined(_YVALS) && !defined(__IBMCPP__)) ||
defined(_CPPLIB_VER)
which are ugly enough to be hopefully confined to a single place ;-)
The modification I was suggesting would consist of a simple
#define
for each library supported in select_stdlib_config.hpp. Nothing else.
P.S.: today I'm quite busy: sorry if I said some nonsense, I may have
missed some important point made in the other posts.
Genny.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk