簡體   English   中英

C ++模板類構造函數

[英]C++ template class constructor

我有一堂課:

template<typename T, typename S>
class filterable_data
{
    /* ... */
};

我創建了這兩個實例:

filterable_data<int, char> a;
filterable_data<int, bool> b = a;

我的問題是,如何正確編寫該構造​​函數?

通過使其也為模板:

template<typename T2, typename S2>
filterable_data(const filterable_data<T2, S2>& other);

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM