How it works...
The boost::disable_if_c<bool_value>::type metafunction disables the method, if bool_value equals true. It works just like boost::enable_if_c<!bool_value>::type.
A class passed as the second parameter for boost::enable_if_c or boost::disable_if_c is returned via ::type in the case of successful substitution. In other words, boost::enable_if_c<true, T>::type is the same as T.
Let's go through the process_data(i, i, i) case, step by step. We pass an int as T type and the compiler searches for function process_data(int, int, int). Because there is no such function, the next step is to instantiate a template version of process_data. However, there are two template process_data functions. For example, the compiler starts instantiating ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access