4

トピックの主題は次のとおりです。

#include <string>
#include <iostream>

void test(bool val)
{
    std::cout << "bool" << std::endl;
}

void test(std::string val)
{
    std::cout << "std::string" << std::endl;
}

int main(int argc, char *argv[])
{
    test("hello");
    return 0;
}

プログラムの出力はbool. boolバリアントが選択された理由

4

2 に答える 2