Код: Выделить всё
template
explicit copyable_function(std::in_place_type_t,
CArgs&&... args);
template
explicit copyable_function(std::in_place_type_t,
std::initializer_list il, CArgs&&... args);
Код: Выделить всё
struct Functor {
Functor(int, int) {
}
Functor(std::initializer_list) {
}
void operator()() const {
}
};
< /code>
std::copyable_function(std::in_place_type, 1, 2)Если мы хотим позвонить в Functor :: functor (std :: initiazer_list ), просто используйте std :: copyable_function (std :: in_place_type , std :: initializer_list {1, 2}) .
Оба случая являются интуитивными и не является двусмысленностью. Итак, мой вопрос:
Зачем нам нужен второй CTOR, а первого достаточно?
Подробнее здесь: https://stackoverflow.com/questions/796 ... e-function
Мобильная версия