トップページ > プログラム > 2015年09月18日 > 5wBzpDO5

書き込み順位&時間帯一覧

2 位/155 ID中時間01234567891011121314151617181920212223Total
書き込み数0000000000110000012110007



使用した名前一覧書き込んだスレッド一覧
デフォルトの名無しさん
【統計分析】機械学習・データマイニング5 [転載禁止]©2ch.net
C++相談室 part119 [転載禁止]©2ch.net

書き込みレス一覧

【統計分析】機械学習・データマイニング5 [転載禁止]©2ch.net
57 :デフォルトの名無しさん[sage]:2015/09/18(金) 10:13:58.13 ID:5wBzpDO5
sageろカス
C++相談室 part119 [転載禁止]©2ch.net
279 :デフォルトの名無しさん[]:2015/09/18(金) 11:51:31.83 ID:5wBzpDO5
stlのiteratorであることを調べる方法はありますか?
iterator_treitsで型が定義されているかどうかを
調べられるかということです
C++相談室 part119 [転載禁止]©2ch.net
282 :デフォルトの名無しさん[]:2015/09/18(金) 17:58:07.46 ID:5wBzpDO5
#include <iostream>
using namespace std;
template<typename T>
struct A{
using type =int;
};
template <typename T>
auto f(typename A<T>::type& a){
return a;
}


int main() {
typename A<int>::type x;
cout<<f(x)<<endl;
// your code goes here
return 0;
}
どうやってマッチするようにできますか
>>280
ありがとうございます
C++相談室 part119 [転載禁止]©2ch.net
283 :デフォルトの名無しさん[]:2015/09/18(金) 18:27:30.80 ID:5wBzpDO5
#include <iostream>
using namespace std;
#include <iostream>
using namespace std;

template<typename T>
struct A{
struct B{};
using type =B;
};
template <typename T>
auto f(typename A<T>::type& a){
return a;
}

int main() {
typename A<int>::B x;
f<typename A<int>::B>(x);
// your code goes here
return 0;
}
ソースコードを間違えました。
こちらでお願いします。 👀
Rock54: Caution(BBR-MD5:0be15ced7fbdb9fdb4d0ce1929c1b82f)

C++相談室 part119 [転載禁止]©2ch.net
284 :デフォルトの名無しさん[]:2015/09/18(金) 18:37:33.56 ID:5wBzpDO5
すみません
ソースコードをまた間違えました
これが最後です
#include <iostream>
using namespace std;
#include <iostream>
using namespace std;

template<typename T>
struct A{
struct B{};

};
template <typename T>
auto f(typename A<T>::B a){
return a;
}

int main() {
typename A<int>::B x;
f<typename A<int>::B>(x);
// your code goes here
return 0;
}
C++相談室 part119 [転載禁止]©2ch.net
285 :デフォルトの名無しさん[]:2015/09/18(金) 19:41:08.07 ID:5wBzpDO5
これが最後の最後です。
コードを短くしてわかりやすくしてみました
#include<vector>
using namespace std;
template <typename T> auto f(typename vector<T>::iterator t){};
int main() {
std::vector<int> a;
f<typename vector<int>::iterator>(a.begin());
return 0;
}
C++相談室 part119 [転載禁止]©2ch.net
287 :デフォルトの名無しさん[]:2015/09/18(金) 20:44:44.53 ID:5wBzpDO5
http://ideone.com/iKRfDL
自己解決しました
ありがとうございました


※このページは、『2ちゃんねる』の書き込みを基に自動生成したものです。オリジナルはリンク先の2ちゃんねるの書き込みです。
※このサイトでオリジナルの書き込みについては対応できません。
※何か問題のある場合はメールをしてください。対応します。