C++使用using定义类型别名时报错
#include <iostream>
#include <string>
using StringView = std::string;
int main()
{
std::cout<<StringView("hello world\n");
return 0;
}
运行结果及报错内容
编译环境为gcc version 5.4.0 (x86_64-posix-sjlj-rev0, Built by MinGW-W64 project)
我想要达到的结果
为std::string定义别名StringView,并使用StringView("hello world\n")实例化一个字符串