Boost logo

Boost :

From: Jonathan Turkanis (technews_at_[hidden])
Date: 2004-10-26 17:27:56


Hi,
    I'm trying to use Boost.Assign to test an output formatting facility, but
I'm having trouble translating pseudocode with brace-initializers into working
C++. E.g., how to you translate this:

    vector< list< pair<string, string> > > v =
        { { make_pair("hello", "goodbye"),
            make_pair("morning", "evening"),
            make_pair("cold", "hot") },
          { make_pair("hello", "goodbye"),
            make_pair("morning", "evening"),
            make_pair("cold", "hot") } };

The following works on VC7.1, but not on como or gcc 3.4.1:

    vector< list< pair<string, string> > > v =
        list_of(
            list_of( make_pair("hello", "goodbye") )
                   ( make_pair("morning", "evening") )
                   ( make_pair("cold", "hot") )
        )
        (
            list_of( make_pair("hello", "goodbye") )
                   ( make_pair("morning", "evening") )
                   ( make_pair("cold", "hot") )
        );

What am I doing wrong?

Best Regards,
Jonathan


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