|
Boost : |
Subject: Re: [boost] Reimplementation of the MPL for C++11
From: Agustín K-ballo Bergé (kaballo86_at_[hidden])
Date: 2013-10-22 11:34:11
On 22/10/2013 10:27 a.m., Larry Evans wrote:
> On 10/21/13 22:51, Agustín K-ballo Bergé wrote:
>> On 22/10/2013 12:28 a.m., Larry Evans wrote:
>>> On 10/20/13 10:33, Agustín K-ballo Bergé wrote:
>>>> On 20/10/2013 09:04 a.m., Larry Evans wrote:
>>> [snip]
>>>>> The code here:
>>>>>
>>>>> http://svn.boost.org/svn/boost/sandbox/variadic_templates/sandbox/slim/
>>>>>
>>>>>
>>>>> might be helpful. It was based on Chrisopher's code but had
>>>>> to be modified slightly as mentioned in the post:
>>>>>
>>>>> http://comments.gmane.org/gmane.comp.compilers.clang.devel/24145
>>>>>
>>>>> which also mentions the slow compile times when not using the
>>>>> preprocessor.
>>>>>
>>>>
>>>> Compilers appear to have improved since then! I decided to take
>>>> gcc4.8.1
>>>> and fusion::map for a spin, since I happen to have a variadic
>>>> implementation of map that does not use recursion. The results of this
>>>> crude exercise can be found here:
>>>> https://gist.github.com/K-ballo/a44590159133997abcdc
>>>
>>> This link only has the test driver code and the test results file.
>>> Could you please provide a link to the implementation of this
>>> non-recursive map?
>>>
>>
>> Certainly, you can find the proof of concept implementation I used for
>> the tests here: http://fusionfenix.com/ktests/boost.fusion.map.zip
>> It is intended to be used with Boost.Fusion from trunk, you just need to
>> replace fusion's "map" directory with the "map_" one in the zip.
>>
>
> The map.hpp in the zip file shows it uses the preprocessor:
> --{--cut here--
>
> namespace boost { namespace fusion
> {
> struct void_;
> struct fusion_sequence_tag;
>
> template <BOOST_PP_ENUM_PARAMS(FUSION_MAX_MAP_SIZE, typename T)>
> struct map :
> sequence_base<map<BOOST_PP_ENUM_PARAMS(FUSION_MAX_MAP_SIZE, T)> >
> {
> struct category : random_access_traversal_tag, associative_tag {};
> --}--cut here--
>
You are looking at the C++03 implementation, the one provided by Fusion
already, which is only picked #if
!defined(BOOST_FUSION_HAS_VARIADIC_MAP). The C++11 declaration is the
obvious one:
template <typename ...T>
struct map;
> Was:
>
> defined(BOOST_FUSION_DONT_USE_PREPROCESSED_FILES)
>
> for the both C++11 tests or not?
>
I don't think it was, but it might have been... It is irrelevant for the
C++11 implementations.
Regards,
-- Agustín K-ballo Bergé.- http://talesofcpp.fusionfenix.com
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk