我有一段包含模板template参数的代码。
render() {
const { t } = this.props;
return (
<div className="trades-table__controls-wrap">
<div className="trades-table__controls">
<UncontrolledDropdown>
<DropdownToggle className="icon icon--right" outline size="sm">
<p>
{t('history.controls.show')}
{this.state.rows}
{t('history.controls.results')}
<MenuDownIcon />
</p>
</DropdownToggle>
<DropdownMenu className="dropdown__menu">
<DropdownItem onClick={() => this.changeRowAmount(10)}>10</DropdownItem>
<DropdownItem onClick={() => this.changeRowAmount(25)}>25</DropdownItem>
<DropdownItem onClick={() => this.changeRowAmount(50)}>50</DropdownItem>
<DropdownItem onClick={() => this.changeRowAmount(100)}>100</DropdownItem>
</DropdownMenu>
</UncontrolledDropdown>
</div>
<div className="trades-table__controls-right">
<div className="trades-table__control-search">
<input placeholder="Search" />
<div className="trades-table__control-search-icon"><MagnifyIcon /></div>
</div>
</div>
</div>
);
}
我发现template<template<typename T, T> class ElementOp>
struct OtherOperation
{
typedef void Result;
};
template<template<typename T, T> class ElementOp>
struct LinkOperation
{
public:
typedef typename OtherOperation<ElementOp>::Result Result;
};
int main()
{
return 0;
}
报告了它的构建错误,但clang x86-64 4.0 -std=c++11
没有报告。有谁知道这是怎么回事?谢谢。