[過去ログ]
Visual Studio 2017 Part5 (1002レス)
Visual Studio 2017 Part5 http://mevius.5ch.net/test/read.cgi/tech/1520336504/
上
下
前次
1-
新
通常表示
512バイト分割
レス栞
抽出解除
必死チェッカー(本家)
(べ)
自ID
レス栞
あぼーん
このスレッドは過去ログ倉庫に格納されています。
次スレ検索
歴削→次スレ
栞削→次スレ
過去ログメニュー
50: デフォルトの名無しさん (ワッチョイ 6a8a-aWcx) [sage] 2018/03/13(火) 11:55:44.24 ID:cL/fN0Uj0 templateで int main()が無いとビルドは通らないでしょう あとint main()でtemplateを{}で括るとブロックが大きすぎますとエラーが出る http://mevius.5ch.net/test/read.cgi/tech/1520336504/50
51: デフォルトの名無しさん (ワッチョイ 6a8a-aWcx) [sage] 2018/03/13(火) 12:07:17.57 ID:cL/fN0Uj0 int main() { template<typename T> struct A { }; template<typename T> struct B { operator A<T>() { return A<T>();//このように定義すれば問題はないが } operator A<T>()const;//定義を外に出すと関数定義が見つからないと出る。 }; template<typename T> B<T>::operator A<T>() const{ return A<T>(); } } これやるとブロックが大きすぎますとエラーがでる http://mevius.5ch.net/test/read.cgi/tech/1520336504/51
53: デフォルトの名無しさん (ワッチョイ 6a8a-aWcx) [sage] 2018/03/13(火) 12:21:18.39 ID:cL/fN0Uj0 template<typename T> struct A { }; template<typename T> struct B { operator A<T>() { return A<T>();//このように定義すれば問題はないが } int main() { const B<int> b; A<int> a = b; std::cout << "Hello, Wandbox!" << std::endl; } これでokって事か http://mevius.5ch.net/test/read.cgi/tech/1520336504/53
54: デフォルトの名無しさん (ワッチョイ 6a8a-6CfZ) [sage] 2018/03/13(火) 14:03:04.99 ID:cL/fN0Uj0 VS2017の15.6.1の環境で 問題なくビルド通るよコンパイラ最新の状態にした方がいいよ 念のためも一度 #include "stdafx.h" #include <iostream> template<typename T> struct A { }; template<typename T> struct B { operator A<T>() { return A<T>();//このように定義すれば問題はないが } operator A<T>()const;//定義を外に出すと関数定義が見つからないと出る。 }; template<typename T> B<T>::operator A<T>() const { return A<T>(); } int main() { const B<int> b; A<int> a = b; std::cout << "Hello, Wandbox!" << std::endl; } http://mevius.5ch.net/test/read.cgi/tech/1520336504/54
メモ帳
(0/65535文字)
上
下
前次
1-
新
書
関
写
板
覧
索
設
栞
歴
スレ情報
赤レス抽出
画像レス抽出
歴の未読スレ
Google検索
Wikipedia
ぬこの手
ぬこTOP
0.041s