#include <iostream>
struct A
{
void update(bool const & v)
{
std::cout << std::boolalpha << v << std::endl;
}
void update(std::string_view v)
{
std::cout << v << std::endl;
}
};
template <typename T>
void update(T const & item)
{
A a;
a.update(item);
}
int main()
{
const char * i = "string";
update(i);
}
когда я вызываю update с const char *
, компилятор вызывает функцию с аргументом bool
вместо string_view
?!почему ??!