我花了 3 个小时弄清楚发生了什么事,但找不到答案。我是 HTML 新手,智能感知可以帮助我随时随地了解标签的许多属性。但是,对于 .vue 文件,html 属性不会显示。
a) “index.html”中显示的属性
b) “TodoItem.vue”中没有属性提示
我已经从市场安装了 Vetur、HTML CSS 支持和 Vue VSCode Snippets 扩展。
我想写出模板化的函数
这是我编写的代码片段,但会产生编译错误
template <template<typename, typename> class Container,
typename Value,
typename Allocator = std::allocator<Value> >
void printContainer(Container<Value, Allocator>::iterator itBegin,
Container<Value, Allocator>::iterator itEnd)
{
copy(itBegin, itEnd, ostream_iterator<Value>(cout, " "));
cout << endl;
}
Run Code Online (Sandbox Code Playgroud)
产生的错误是:
error 1: variable or field ‘printContainer’ declared void
void printContainer(Container<Value, Allocator>::iterator itBegin,
^
error 2: expected ‘)’ before ‘itBegin’
void printContainer(Container<Value, Allocator>::iterator itBegin,
^
error 3: expected ‘)’ before ‘itEnd’
Container<Value, Allocator>::iterator itEnd)
^
p00441.cpp: In function ‘int main()’:
p00441.cpp:10:39: error: ‘printContainer’ …
Run Code Online (Sandbox Code Playgroud)