May a compiler elide the evaluation of the “not-taken” branch in a constexpr function?
问题 While attempting to answer a question by Mehrdad, I concocted the little function below (in action at liveworkspace): template <typename T, unsigned low, unsigned high> static constexpr auto highest_index_in() -> typename std::enable_if<high >= low, unsigned>::type { return low == high ? low : high == low + 1 ? (exists<T, high>() ? high : low) : exists<T, (high + low)/2>() ? highest_index_in<T, (high+low)/2, high>() : highest_index_in<T, low, (high+low)/2>(); } // highest_index_in (where