|
Boost : |
From: Daryle Walker (darylew_at_[hidden])
Date: 2001-02-26 12:13:55
on 2/25/01 9:52 PM, Jens Maurer at Jens.Maurer_at_[hidden] wrote:
> That's my code, so I should probably say something.
>
> Daryle Walker wrote:
>> The problem is in a template parameter description in "random.hpp", lines
>> 383 through 391:
>
> [shortened to remove compiler-workaround]
>
>>> // L'Ecuyer 1988
>>> template<class MLCG1, class MLCG2, typename MLCG1::result_type val>
>>> class additive_combine
>>
>> The rest of the class template continues from there. The problem is that my
>> compiler chokes on the fourth line ("typename MLCG1::result_type") here,
>> claiming something like "illegal name overloading."
>>
>> I guess the problem is an ambiguity between the types of template
>> parameters:
>>
>> 1. A type
>> A. "class" [formal_parameter_name ["=" default_value]]
>> B. "typename" [formal_parameter_name ["=" default_value]]
>
>> 3. A value
>> A. type_name [formal_parameter_name ["=" default_value]]
>>
>> When using a type name that is within a class template, you have to use the
>> "typename outer_type::inner_type" syntax. That is what the writer did here.
>> However, this case of 3A also looks like 1B! The compiler is choosing 1B,
>> then choking because the formal_parameter isn't a single identifier.
>
> That's exactly the point: The formal_parameter is not a single identifier,
> thus it cannot be case 1B. If your compiler is unable to properly
> determine this, use the work-around #define. What compiler are you using,
> btw.?
[TRUNCATE]
I'm using Metrowerks CodeWarrior Pro 5, with 5.3 update, for the Mac OS. I
guess we need to set BOOST_NO_DEPENDENT_TYPES_IN_TEMPLATE_VALUE_PARAMETERS
in "config.hpp". We also have to check CWP5(.3) for Windows, CWP6 for both
systems, and CWP6 with 6.1 update for both systems. Can anyone out there
check those other related configurations?
For now, do I alter my copy of "config.hpp" to:
> # elif defined __MWERKS__
> # if __MWERKS__ <= 0x4000 // is this CWP6?
> # define BOOST_NO_MEMBER_TEMPLATE_FRIENDS
> // maybe the #define two steps down goes here instead
> # endif
> # if __MWERKS__ <= 0x2301 // is this CWP5.3?
> # define BOOST_NO_POINTER_TO_MEMBER_CONST
> # define BOOST_NO_DEPENDENT_TYPES_IN_TEMPLATE_VALUE_PARAMETERS
> # endif
> # if __MWERKS__ >= 0x2300
> # define BOOST_SYSTEM_HAS_STDINT_H
> # endif
> # if defined BOOST_DECL_EXPORTS
> # if defined BOOST_DECL_IMPORTS
> # error Not valid to define both BOOST_DECL_EXPORTS and
BOOST_DECL_IMPORTS
> # endif
> # define BOOST_DECL __declspec(dllexport)
> # elif defined BOOST_DECL_IMPORTS
> # define BOOST_DECL __declspec(dllimport)
> # else
> # define BOOST_DECL
> # endif
-- Daryle Walker Mac, Internet, and Video Game Junkie darylew AT mac DOT com
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk