| 41 | | typedef value_type reference; |
| | 43 | |
| | 44 | // reference is needed for two reasons: |
| | 45 | // |
| | 46 | // 1. It is used in the body of arg_list<...> |
| | 47 | // |
| | 48 | // 2. It is the result of binding<...>, which we mistakenly told |
| | 49 | // people to use instead of value_type<...> to access named |
| | 50 | // template parameters |
| | 51 | // |
| | 52 | // It used to be that reference == value_type, but that broke when |
| | 53 | // the argument was a function or array type, because various |
| | 54 | // arg_list functions return reference. |
| | 55 | // |
| | 56 | // Simply making reference == value_type& would break all the |
| | 57 | // legacy code that uses binding<...> to access named template |
| | 58 | // parameters. |
| | 59 | typedef typename mpl::if_< |
| | 60 | mpl::or_<is_function<value_type>, is_array<value_type> > |
| | 61 | , value_type& |
| | 62 | , value_type>::type reference; |