Joel de Guzman
- bind expression with tuple becomes a nightmare
Why? Ah access to the members?
Yes. boost::bind(&tp::get<1>, _1) does not work (something to do with bind's difficulties with overloads and return types?). This can be overcome by using Karlsson's tuple_select.
- default initialising of its members is m_member() (while sometimes we reserve -1 for uninitialised)
Dunno what you mean. Please elaborate.
Oh this simple. Let says one has a tuple with handles boost::tuple<HANDLE>; In Win32 an INVALID_HANDLE_VALUE is defined as -1. So if one writes: boost::tuple<HANDLE> tp; If at the moment of definition, the actual values are not known, it should be default intialised with invalid handles (-1) and not with zeros, which can represent valid file handles. This can of course be overcome with an extra intialiser e.g. const boost::tuple<HANDLE> g_tpInvalid(INVALID_HANDLE_VALUE); and then always write: boost::tuple<HANDLE> tp = tpInvalid; but this is an extra step. Using a structure one could handle that in the defualt constructor. Wkr, me