給定模板別名可以將模板別名用於部分專業化嗎?
template<unsigned U>
using uint_ = integral_constant<unsigned,U>;
的同時用gcc不產生警告
template<class T,class P>
struct size{};
作爲
template <class T,unsigned U>
struct size<T,uint_<U>>{};
生成警告作爲template parameter can not be deduced
爲鐺3.1部分特4.7
那麼,它是否發生故障形式化代碼?
我看不出沒有理由不應該這樣。別名模板立即被替換。 –
不僅它在叮噹聲3.1中給出警告,而且如果我嘗試實例化它,它會忽略專業化。但是,直接使用integral_constant替代別名的方式與往常一樣。我想這是叮噹蟲。 – abir
@abir:這意味着模板別名在Clang中沒有正確實現。 – Nawaz