Код: Выделить всё
#include
template
struct fn_ref_call;
template
struct fn_ref_call {
static constexpr bool enable = true;
};
template
struct fn_ref : private fn_ref_call {
private:
using base = fn_ref_call;
public:
template
requires (base::enable)
fn_ref(F* f){}
};
template
requires std::is_function_v
fn_ref(F *) -> fn_ref;
int fn(int) { return 3; }
int main() {
fn_ref f{&fn};
}
Clang пытается использовать неопределенный основной шаблон для CTAD.
Вопросы:
- Правильен ли здесь clang?
- Есть ли обходной путь?
Подробнее здесь: https://stackoverflow.com/questions/798 ... y-template
Мобильная версия