An attempt to adapt std::array
for Boost.Fusion.
The implementation is functional and passes the same test as adapted Boost.Array.
Proposal thread on the Boost mailing list: [fusion] Adapter for std::array.
However, there is a problem with ADL and range-based access to the sequence which is a well-known issue:
- Fusion begin/end ADL issues with C++0x range-based for
- Boost ticket: fusion::begin and fusion::end lead to problems with ADL-based begin and end functions for ranges
- Boost ticket: Treat std::array as a Fusion sequence
See also:
-
N3257=11-0027 Jonathan Wakely and Bjarne Stroustrup: Range-based for statements and ADL. Option 5 was chosen for C++11.
-
Jonathan Wakely's review of the issue regarding the Boost.Fusion adaptor for
std::string
:The standard was changed to not use unqualified begin/end when the type has begin/end members, because when there are multiple "greedy" overloads that can be found by ADL there is no simple way to prevent ambiguity. So I agree that your best option might be to avoid those unqualified calls.