Boost logo

Boost :

From: Michael Marcin (mike_at_[hidden])
Date: 2006-12-22 06:27:38


Michael Marcin wrote:
> Michael Marcin wrote:
>> Attached is a simple repro (taken directly from the fusion::map
>> documentation example).
>>
>
> Hmm attachment didn't go through too well sending via outlook express
> and received here via Thunderbird. I've recreated it and pasted it
> below. Tested and fails with vs2005, vs2005sp1, and vs2003
>

Did the way map works at some point get changed from fusion::at to
fusion::at_key and the docs are just out of date?

The code below seems to work.

- Michael Marcin

----------------

#include <iostream>
#include <string>

#include <boost/fusion/support/pair.hpp>
#include <boost/fusion/sequence/container/map.hpp>
#include <boost/fusion/sequence/intrinsic/at_key.hpp>

int main()
{
        using namespace boost::fusion;

        typedef map< pair<int, char>
                , pair<double, std::string> >
        map_type;

        map_type m( make_pair<int>('X')
                          , make_pair<double>("Men") );

        std::cout << at_key<int>(m) << std::endl;
        std::cout << at_key<double>(m) << std::endl;

        return 0;
}


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