Opened 12 years ago

Closed 11 years ago

#5273 closed Bugs (fixed)

question about fusion and documentation

Reported by: ramey@… Owned by: danmarsden
Milestone: To Be Determined Component: fusion
Version: Boost 1.45.0 Severity: Problem
Keywords: Cc:

Description

I'm having a problem distinguishing the difference between metafunctions at_key and value_at_key. The documentation for value_at_key shows the following example:

typedef map<pair<int, char>, pair<char, char>, pair<double, char> > mymap;
BOOST_MPL_ASSERT((boost::is_same<result_of::at_key<mymap, int>::type, char>));

note the absence of value_at_key in the example! while the example in at_key shows

typedef map<pair<int, char>, pair<char, char>, pair<double, char> > mymap;
BOOST_MPL_ASSERT((boost::is_same<result_of::at_key<mymap, int>::type, char&>));

I see the & indicating a reference, but I can't see how this would be any different than using add_reference to the result of at_value_key.

Any little bit of light you might want shed here would be helpful. At the very least, I think the documention should be clarified.

Robert Ramey

Change History (2)

comment:1 by Steven Watanabe, 12 years ago

I assume that in some cases at_key can return an rvalue. (For example with transform_view).

comment:2 by Robert Ramey, 11 years ago

Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.