This implementation is O(n^2). We could do it in O(n), but that would require a more elaborate setup including storage with O(1) lookup (which could be based on a compile-time hash). If we implement such storage for associative sequences, we could use it to optimize this.
We can't specify the signature right now, because the tag of the returned object depends on whether x < y or not. If we wanted to be mathematically correct, we should probably ask that if_(cond, x, y) returns a common data type of x and y, and then the behavior of min would follow naturally. However, I'm unsure whether this is desirable because that's a big requirement.
Improve this explanation and talk about non-integral constant expressions wrapped into types.
Explain how side-effects may not appear inside constant expressions, even if the expression they yield are not accessed.
Статья Boost.Hana: Todo List раздела может быть полезна для разработчиков на c++ и boost.
Материалы статей собраны из открытых источников, владелец сайта не претендует на авторство. Там где авторство установить не удалось, материал подаётся без имени автора. В случае если Вы считаете, что Ваши права нарушены, пожалуйста, свяжитесь с владельцем сайта.