Out of Memory

本ブログは更新を停止しました。Aerieをよろしくお願いいたします。

目次

Blog 利用状況

ニュース

2009年3月31日
更新を停止しました。引き続きAerieを御愛顧くださいませ。
2009年2月3日
原則としてコメント受付を停止しました。コメントはAerieまでお願いいたします。
詳細は2月3日のエントリをご覧ください。
2008年7月1日
Microsoft MVP for Developer Tools - Visual C++ を再受賞しました。
2008年2月某日
MVPアワードがVisual C++に変更になりました。
2007年10月23日
blogタイトルを変更しました。
2007年7月1日
Microsoft MVP for Windows - SDKを受賞しました!
2007年6月20日
スキル「ニュース欄ハック」を覚えた!
2006年12月14日
記念すべき初エントリ
2006年12月3日
わんくま同盟に加盟しました。

カレンダー

中の人

αετο? / aetos / あえとす

シャノン? 誰それ。

顔写真

埼玉を馬鹿にする奴は俺が許さん。

基本的に知ったかぶり。興味を持った技術に手を出して、ちょっと齧りはするものの、それを応用して何か形にするまでは及ばずに飽きて放り出す人。

書庫

日記カテゴリ

protected readonly 変数は

派生クラスのコンストラクタから初期化できない。

へー。

投稿日時 : 2008年5月1日 0:10

Feedback

# re: protected readonly 変数は 2008/05/01 1:06 Streetw☆

へー。
調べたら、internalでもpublicでも、とにかくreadonlyの仕様でした。
(ヘルプのreadonly見ました。)
abstract classのだったら、もしかしたらできるかも!
っと思ってしてみたけど、やっぱりダメでしたw

# re: protected readonly 変数は 2008/05/01 6:31 出水

readonlyということは、変数じゃなくて定数だから
派生クラスで初期化できる→派生クラスごとに値が変わる
それは変数じゃん!って事なんですかねぇ?

# re: protected readonly 変数は 2008/05/01 10:19 じゃんぬねっと

readonly は定数ではありません。
コンストラクタの時のみ値変更が可能な変数です。

# re: protected readonly 変数は 2008/05/01 12:54 Streetw☆

readonlyはインスタンスごとに値は変わるけど、
そのルールが派生クラスで変わるのはダメってことですかね?
でも、下のはできるし。
public class Test1
{
 public readonly string Value;
 public Test1() { Value = ValueValue(); }
 protected virtual string ValueValue() { return "aiu"; }
}
public class Test2 : Test1
{
 protected override string ValueValue() { return "あいう"; }
}

# re: protected readonly 変数は 2008/05/01 15:09 シャノン

それはそれで、コンストラクタから仮想メソッドを呼ぶのはどうなの? っていう問題があるかも。
俺は OK 派なんだけど、ダメって言う人もいる。C++ はダメだし。

# re: protected readonly 変数は 2008/05/01 16:36 Streetw☆

できるのかなって思いながらしてみたらできたんですけど、良くないんですね。

検索してみたら、心得が書いてました。
http://msdn.microsoft.com/ja-jp/library/ms182331.aspx

コード分析を実行してみたら、警告でました。
こちらの方が文章からとっても危険な香りがしてきますw
「警告 8 CA2214 : Microsoft.Usage : 'Test1.Test1()' には、クラスによって定義された仮想メソッドへの呼び出しの原因となる呼び出しチェーンが含まれます。予期しない事態のため次の呼び出し履歴を確認してください」

囚人さんの記事も見つかりました。まだ生まれてない頃の記事ですw
http://blogs.wankuma.com/shuujin/archive/2006/04/18/22541.aspx

# Greetings! Very useful advice within this post! It's the little changes that make the biggest changes. Thanks a lot for sharing! 2019/04/10 9:54 Greetings! Very useful advice within this post! It

Greetings! Very useful advice within this post! It's the little changes that make the biggest changes.
Thanks a lot for sharing!

# I don't even know how I ended up here, but I thought this post was great. I do not know who you are but definitely you are going to a famous blogger if you aren't already ;) Cheers! 2019/06/23 18:38 I don't even know how I ended up here, but I thoug

I don't even know how I ended up here, but I thought this
post was great. I do not know who you are but definitely you are going to a famous blogger if you aren't already
;) Cheers!

# great points altogether, you simply won a new reader. What could you recommend in regards to your put up that you just made a few days in the past? Any sure? 2019/07/25 21:10 great points altogether, you simply won a new read

great points altogether, you simply won a new reader.
What could you recommend in regards to your put up that you just made
a few days in the past? Any sure?

# great points altogether, you simply won a new reader. What could you recommend in regards to your put up that you just made a few days in the past? Any sure? 2019/07/25 21:11 great points altogether, you simply won a new read

great points altogether, you simply won a new reader.
What could you recommend in regards to your put up that you just made
a few days in the past? Any sure?

# great points altogether, you simply won a new reader. What could you recommend in regards to your put up that you just made a few days in the past? Any sure? 2019/07/25 21:12 great points altogether, you simply won a new read

great points altogether, you simply won a new reader.
What could you recommend in regards to your put up that you just made
a few days in the past? Any sure?

# great points altogether, you simply won a new reader. What could you recommend in regards to your put up that you just made a few days in the past? Any sure? 2019/07/25 21:13 great points altogether, you simply won a new read

great points altogether, you simply won a new reader.
What could you recommend in regards to your put up that you just made
a few days in the past? Any sure?

# uBaZhkfUvKWgDch 2021/07/03 4:12 https://www.blogger.com/profile/060647091882378654

I was suggested this website by my cousin. I am not sure whether this post is written by him as no one else know such detailed about my trouble. You are wonderful! Thanks!

# re: protected readonly ??? 2021/08/09 15:37 hydroxychloroquine sulfate side effects

choloquine https://chloroquineorigin.com/# hydroxychloroquine sulfate tablets

# a2bqygx 2021/11/17 6:48 bahamut1001

http://www.ebahao.com/home.php?mod=space&uid=403764

# ZenUxDCBrubgc 2022/04/19 13:31 johnansaz

http://imrdsoacha.gov.co/silvitra-120mg-qrms

# qijlylepljmy 2022/06/02 9:52 ohnmqvev

erythromycin ophthalmic ointment usp 0.5 https://erythromycinn.com/#

# chloroquine tablets price 2022/12/27 17:23 MorrisReaks

https://www.hydroxychloroquinex.com/# hydroxychloroquine sulfate 200mg

タイトル
名前
Url
コメント