Boost logo

Boost :

From: Michael Stevens (michael_at_[hidden])
Date: 2002-05-02 21:57:22


Two recent posting got me looking again an the Quaternion and special_functions library.

    Date: Mon, 29 Apr 2002 03:07:46 -0700 (PDT)
    From: Fredrik Blomqvist <f_blq_at_[hidden]>
    To: boost_at_[hidden]
    Subject: [boost] quat and oct ported to MSVC6

Thanks for Fredrik it seems that it is fairly easy to get the Quaternion
and Octonican libraries to work in MSVC6. I've taken the patch versions
and check for compatibility under MSVC7. Then new quaternion.hpp and
octonian.hpp are fine. However sinc.hpp and sinch.hpp are a little more
ticky.
Fredrik's solution to get them to work under MSVC is to remove the
template template definition of sinc_pi using

    #ifndef BOOST_NO_DEPENDENT_TYPES_IN_TEMPLATE_VALUE_PARAMETERS
            template<typename T, template<typename> class U>
            inline U<T> sinc_pi(const U<T> x)

This works for MSVC6 but really is not quite correct as this isn't
really the correct compiler deficiency.This is a template template non a
dependant template type parameter. The problem is MSVC7 does support the
latter but not the former! The question has come up very recently in a
different context.

    From: "Gennadiy Rozental" <rogeeff_at_[hidden]>
    Date: Tue, 30 Apr 2002 01:19:36 -0400
    "David B. Held" <dheld_at_[hidden]> wrote in message
    news:aakfs8$ug3

>> 2a. There doesn't appear to be any config macros for say,
>> BOOST_NO_TEMPLATE_TEMPLATE_PARAMETERS.
>No. this mean that Boost libraries are not using template template
>parameters yet ( am I right?)
>
I think sinc(h).hpp may be the only place that template template
parameters are used in BOOST. So maybe it is not appropraite to add yet
another deficiency macro. A useful compromise that assumes that anything
with the MSVC member template problem is also defincient for template
templates (this included MSVC7) and that a future MSVC won't have ethe
problem. I therefore propose the the following test in sinc(h).hpp

#if !defined(BOOST_NO_DEPENDENT_TYPES_IN_TEMPLATE_VALUE_PARAMETERS) &&
!defined(BOOST_MSVC6_MEMBER_TEMPLATES)

What does everyone think?

The modifications to quaternion/octonian_test.cpp also need a bit of
work for MSVC7. This compiler has the correct float./double versions of
abs in math.h. Sadly they are only defined when /Za (disable microsoft
extensions) is used!
Therefore the following #if will allow a correct compile and excute test
for MSVC7 with /Za set..

// MSVC6 fails to provide an overloaded fp-abs()!
#if (BOOST_MSVC <= 1200)

I don't recommend compiling quatation/octonian in MSVC without /Za as
all other occuranced of abs will only call the interger overload. Maybe
we should as /Za into the boost build msvc-C++-action.

Michael Stevens


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