東方算程譚

Oriental Code Talk ── επιστημηが与太をこく、弾幕とは無縁のシロモノ。

目次

Blog 利用状況

ニュース

著作とお薦めの品々は

著作とお薦めの品々は
東方熱帯林へ。

あわせて読みたい

わんくま

  1. 東京勉強会#2
    C++/CLI カクテル・レシピ
  2. 東京勉強会#3
    template vs. generics
  3. 大阪勉強会#6
    C++むかしばなし
  4. 東京勉強会#7
    C++むかしばなし
  5. 東京勉強会#8
    STL/CLRによるGeneric Programming
  6. TechEd 2007 @YOKOHAMA
    C++・C++/CLI・C# 適材適所
  7. 東京勉強会#14
    Making of BOF
  8. 東京勉強会#15
    状態遷移
  9. 名古屋勉強会#2
    WinUnit - お気楽お手軽UnitTest

CodeZine

  1. Cで実現する「ぷちオブジェクト指向」
  2. CUnitによるテスト駆動開発
  3. SQLiteで組み込みDB体験(2007年版)
  4. C++/CLIによるCライブラリの.NET化
  5. C# 1.1からC# 3.0まで~言語仕様の進化
  6. BoostでC++0xのライブラリ「TR1」を先取りしよう (1)
  7. BoostでC++0xのライブラリ「TR1」を先取りしよう (2)
  8. BoostでC++0xのライブラリ「TR1」を先取りしよう (3)
  9. BoostでC++0xのライブラリ「TR1」を先取りしよう (4)
  10. BoostでC++0xのライブラリ「TR1」を先取りしよう (5)
  11. C/C++に対応した、もうひとつのUnitTestFramework ─ WinUnit
  12. SQLiteで"おこづかいちょう"
  13. STL/CLRツアーガイド
  14. マージ・ソート : 巨大データのソート法
  15. ヒープソートのアルゴリズム
  16. C++0xの新機能「ラムダ式」を次期Visual Studioでいち早く試す
  17. .NETでマンデルブロ集合を描く
  18. .NETでマンデルブロ集合を描く(後日談)
  19. C++/CLI : とある文字列の相互変換(コンバージョン)
  20. インテルTBBによる選択ソートの高速化
  21. インテルTBB3.0 によるパイプライン処理
  22. Visual C++ 2010に追加されたSTLアルゴリズム
  23. Visual C++ 2010に追加されたSTLコンテナ「forward_list」
  24. shared_ptrによるObserverパターンの実装
  25. .NETでマンデルブロ集合を描く(番外編) ── OpenCLで超並列コンピューティング
  26. StateパターンでCSVを読む
  27. 状態遷移表からStateパターンを自動生成する
  28. 「ソートも、サーチも、あるんだよ」~標準C++ライブラリにみるアルゴリズムの面白さ
  29. インテルTBBの同期メカニズム
  30. なぜsetを使っちゃいけないの?
  31. WPFアプリケーションで腕試し ~C++でもWPFアプリを
  32. C++11 : スレッド・ライブラリひとめぐり
  33. Google製のC++ Unit Test Framework「Google Test」を使ってみる
  34. メールでデータベースを更新するココロミ
  35. Visitorパターンで遊んでみたよ
  36. Collection 2題:「WPFにバインドできる辞書」と「重複を許す検索set」
  37. Visual C++ 2012:stateless-lambdaとSQLiteのぷち拡張
  38. 「Visual C++ Compiler November 2012 CTP」で追加された6つの新機能

@IT

  1. Vista時代のVisual C++の流儀(前編)Vista到来。既存C/C++資産の.NET化を始めよう!
  2. Vista時代のVisual C++の流儀(中編)MFCから.NETへの実践的移行計画
  3. Vista時代のVisual C++の流儀(後編) STL/CLRによるDocument/Viewアーキテクチャ
  4. C++開発者のための単体テスト入門 第1回 C++開発者の皆さん。テスト、ちゃんとしていますか?
  5. C++開発者のための単体テスト入門 第2回 C++アプリケーションの効率的なテスト手法(CppUnit編)
  6. C++開発者のための単体テスト入門 第3回 C++アプリケーションの効率的なテスト手法(NUnit編)

AWARDS


Microsoft MVP
for Visual Developer - Visual C++


Wankuma MVP
for いぢわる C++


Nyantora MVP
for こくまろ中国茶

Xbox

Links

記事カテゴリ

書庫

日記カテゴリ

STL/CLRメモ: map

map: STL/CLR版SortedList<K,V>

二分木による辞書。key(K)とvalue(V)のpairを要素とするsetと思えばいい。
各要素はkeyの大小関係に基づいて配置され、
追加/削除/検索に要する時間計算量はO(logN)

#include <cliext/map>

using namespace System;
using namespace cliext;

int main() {
  map<int,String^> m;
  int i = 0;
  for each ( String^ item in gcnew array<String^> { L"zero", L"one", L"two", L"three" }) {
    m[i++] = item;
  }
  // for each で列挙されるのは key と value の pair
  for each ( map<int,String^>::value_type item in m ) {
    Console::WriteLine(L"{0}:{1} ", item->first, item->second);
  }
  return 0;
}

投稿日時 : 2007年4月26日 14:24

コメントを追加

# re: STL/CLRメモ: map 2007/04/26 15:19 keichan

先生。質問(-д-)ノ
iterator では".演算子"なのに
value_type ではどうして"->演算子"なんですか?

# re: STL/CLRメモ: map 2007/04/26 15:45 επιστημη

こたゑ:
map<int,String^>::value_type はtypedefでして、
ナニのtypedefかっつーと:
Microsoft::VisualC::StlClr::GenericPair<int,String^>^
です。
ケツに ^ がついてますね。だから->なのです。

# re: STL/CLRメモ: map 2007/04/26 15:58 keichan

ご回答ありがとうございます。

ではさらに質問。

通常C++/CLIでクラスをインスタンス化する際はgcnewで生成し、そのハンドルを ^ で表現すると認識しています。
そしてメンバにアクセスする際は ->演算子 を用いる。

しかし、iterator は .演算子 でアクセス可能になっている。

これは、iterator クラスで operator.()をオーバーロード実装されているという認識でよろしいでしょうか?

# re: STL/CLRメモ: map 2007/04/26 16:08 επιστημη

アタリです。便利な演算子をぶっこんでくれてます。

たとえばiteratorが ほげ^ を指してたとき、
iteratorはポインタもどき、参照ハンドルもポインタもどきなので
ほげのメソッド ぱよ を呼ぶには
本来なら (*iter)->ぱよ() となるはず。

なーんだけどそれじゃあまりにキモいので
iter->ぱよ() できちゃったりします。

# re: STL/CLRメモ: map 2007/04/26 16:28 keichan

>iter->ぱよ() できちゃったりします。
ということは
iterator は ->演算子 も .演算子 も等価な動作をするということでしょうか?

# re: STL/CLRメモ: map 2007/04/26 16:49 επιστημη

ところがそーでもないんですよね ^^;

vector<String^> v; v.push_back(L"ほげ");
vector<String^>::iterator iter = v.begin();
Console::WriteLine(iter->Length); // ok
Console::WriteLine(iter.Length); // error

operator-> は定義されてますが
operator. はユーザ定義できませんので。

# re: STL/CLRメモ: map 2007/04/26 17:50 keichan

ふむむ???

operator-> は T を返し、
operator. は T^ を返す?

なんか変なドツボにはまった様な・・・orz

# re: STL/CLRメモ: map 2007/04/26 19:56 επιστημη

Orcasぶっこんで遊んでみるのがいちばんっすよー♪

# re: STL/CLRメモ: map 2007/04/27 13:23 keichan

らじゃっす。遊んでみます♪

# ncXRmWsVdF 2014/08/07 0:40 http://crorkz.com/

SJKon5 Major thanks for the article.Thanks Again. Much obliged.

# tTuyMBQEww 2014/08/28 15:04 http://crorkz.com/

B6xXtT Heya i'm for the first time here. I found this board and I find It truly useful & it helped me out a lot. I hope to give something back and aid others like you aided me.

# FNPltaLoUBns 2014/09/08 18:24 http://www.arrasproperties.com/

I take pleasure in, result in I found exactly what I used to be having a look for. You have ended my four day long hunt! God Bless you man. Have a great day. Bye

# puBuoHefCVbnEIgGt 2014/09/17 7:28 http://www.theboatonlinestore.co.uk/

fantastic issues altogether, you just gained a brand new reader. What might you suggest about your submit that you made a few days ago? Any certain?

# BIkQRAwVkzhcM 2014/09/17 16:10 http://www.1818-888.com

This web page is mostly a stroll-via for the entire data you needed about this and didn't know who to ask. Glimpse here, and you'll definitely uncover it.

# I am truly happy to read this weblog posts which contains plenty of helpful data, thanks for providing these information. 2018/09/24 4:03 I am truly happy to read this weblog posts which

I am truly happy to read this weblog posts which contains plenty of helpful data,
thanks for providing these information.

# I read this article fully regarding the difference of latest and earlier technologies, it's remarkable article. 2018/10/01 10:12 I read this article fully regarding the difference

I read this article fully regarding the difference of latest and earlier technologies, it's remarkable article.

# Hi there, after reading this awesome paragraph i am too delighted to share my knowledge here with mates. 2018/10/07 20:01 Hi there, after reading this awesome paragraph i

Hi there, after reading this awesome paragraph i am too
delighted to share my knowledge here with mates.

# My partner and I stumbled over here by a different web page and thought I may as well check things out. I like what I see so i am just following you. Look forward to finding out about your web page repeatedly. 2018/10/09 16:56 My partner and I stumbled over here by a different

My partner and I stumbled over here by a different web page and thought I may as well check
things out. I like what I see so i am just following you.
Look forward to finding out about your web page repeatedly.

# Right here is the right website for everyone who wants to understand this topic. You know a whole lot its almost tough to argue with you (not that I personally will need to…HaHa). You certainly put a new spin on a topic that's been discussed for many y 2018/10/10 5:55 Right here is the right website for everyone who w

Right here is the right website for everyone who wants to understand this topic.
You know a whole lot its almost tough to argue with you (not that I personally will need to…HaHa).
You certainly put a new spin on a topic that's been discussed for many
years. Great stuff, just wonderful!

# Heya i am for the first time here. I came across this board and I find It truly useful & it helped me out much. I hope to give something back and aid others like you aided me. 2018/11/02 18:30 Heya i am for the first time here. I came across

Heya i am for the first time here. I came across this board and I
find It truly useful & it helped me out much. I hope to give something back and aid others like you aided
me.

# Truly no matter if someone doesn't know afterward its up to other viewers that they will help, so here it happens. 2018/11/13 2:22 Truly no matter if someone doesn't know afterward

Truly no matter if someone doesn't know afterward its up to other viewers that they will help, so here it happens.

# I blog quite often and I truly appreciate your information. This great article has truly peaked my interest. I am going to bookmark your website and keep checking for new information about once a week. I opted in for your RSS feed too. 2019/04/20 12:28 I blog quite often and I truly appreciate your inf

I blog quite often and I truly appreciate your information. This
great article has truly peaked my interest. I am going to bookmark your
website and keep checking for new information about once
a week. I opted in for your RSS feed too.

# I am truly thankful to the holder of this web page who has shared this impressive post at here. 2019/06/17 19:49 I am truly thankful to the holder of this web page

I am truly thankful to the holder of this web page who has shared this impressive post at here.

# Hello! I just wanted to ask if you ever have any trouble with hackers? My last blog (wordpress) was hacked and I ended up losing several weeks of hard work due to no back up. Do you have any methods to prevent hackers? 2019/08/24 3:31 Hello! I just wanted to ask if you ever have any t

Hello! I just wanted to ask if you ever have any trouble with
hackers? My last blog (wordpress) was hacked and I
ended up losing several weeks of hard work due to no back up.
Do you have any methods to prevent hackers?

# I have read so many articles about the blogger lovers however this post is really a pleasant article, keep it up. 2021/08/23 21:42 I have read so many articles about the blogger lov

I have read so many articles about the blogger lovers however
this post is really a pleasant article, keep it up.

# I have read so many articles about the blogger lovers however this post is really a pleasant article, keep it up. 2021/08/23 21:43 I have read so many articles about the blogger lov

I have read so many articles about the blogger lovers however
this post is really a pleasant article, keep it up.

# I have read so many articles about the blogger lovers however this post is really a pleasant article, keep it up. 2021/08/23 21:44 I have read so many articles about the blogger lov

I have read so many articles about the blogger lovers however
this post is really a pleasant article, keep it up.

# I have read so many articles about the blogger lovers however this post is really a pleasant article, keep it up. 2021/08/23 21:45 I have read so many articles about the blogger lov

I have read so many articles about the blogger lovers however
this post is really a pleasant article, keep it up.

# If some one needs to be updated with most up-to-date technologies therefore he must be pay a quick visit this site and be up to date every day. 2021/08/24 10:07 If some one needs to be updated with most up-to-da

If some one needs to be updated with most up-to-date technologies therefore he must be
pay a quick visit this site and be up to date every day.

# If some one needs to be updated with most up-to-date technologies therefore he must be pay a quick visit this site and be up to date every day. 2021/08/24 10:08 If some one needs to be updated with most up-to-da

If some one needs to be updated with most up-to-date technologies therefore he must be
pay a quick visit this site and be up to date every day.

# If some one needs to be updated with most up-to-date technologies therefore he must be pay a quick visit this site and be up to date every day. 2021/08/24 10:09 If some one needs to be updated with most up-to-da

If some one needs to be updated with most up-to-date technologies therefore he must be
pay a quick visit this site and be up to date every day.

# If some one needs to be updated with most up-to-date technologies therefore he must be pay a quick visit this site and be up to date every day. 2021/08/24 10:10 If some one needs to be updated with most up-to-da

If some one needs to be updated with most up-to-date technologies therefore he must be
pay a quick visit this site and be up to date every day.

# Article writing is also a fun, if you know then you can write if not it is complicated to write. 2021/08/25 19:25 Article writing is also a fun, if you know then yo

Article writing is also a fun, if you know then you can write if not it
is complicated to write.

# Article writing is also a fun, if you know then you can write if not it is complicated to write. 2021/08/25 19:26 Article writing is also a fun, if you know then yo

Article writing is also a fun, if you know then you can write if not it
is complicated to write.

# Article writing is also a fun, if you know then you can write if not it is complicated to write. 2021/08/25 19:27 Article writing is also a fun, if you know then yo

Article writing is also a fun, if you know then you can write if not it
is complicated to write.

# Article writing is also a fun, if you know then you can write if not it is complicated to write. 2021/08/25 19:28 Article writing is also a fun, if you know then yo

Article writing is also a fun, if you know then you can write if not it
is complicated to write.

# It is not my first time to go to see this website, i am browsing this site dailly and obtain good data from here all the time. 2021/09/02 7:33 It is not my first time to go to see this website,

It is not my first time to go to see this website, i am browsing this site dailly
and obtain good data from here all the time.

# It is not my first time to go to see this website, i am browsing this site dailly and obtain good data from here all the time. 2021/09/02 7:34 It is not my first time to go to see this website,

It is not my first time to go to see this website, i am browsing this site dailly
and obtain good data from here all the time.

# It is not my first time to go to see this website, i am browsing this site dailly and obtain good data from here all the time. 2021/09/02 7:35 It is not my first time to go to see this website,

It is not my first time to go to see this website, i am browsing this site dailly
and obtain good data from here all the time.

# It is not my first time to go to see this website, i am browsing this site dailly and obtain good data from here all the time. 2021/09/02 7:36 It is not my first time to go to see this website,

It is not my first time to go to see this website, i am browsing this site dailly
and obtain good data from here all the time.

# Very energetic blog, I liked that bit. Will there be a part 2? 2021/10/25 14:22 Very energetic blog, I liked that bit. Will there

Very energetic blog, I liked that bit. Will there be a part 2?

# I'm not sure exactly why but this blog is loading very slow for me. Is anyone else having this problem or is it a problem on my end? I'll check back later on and see if the problem still exists. 2022/01/11 13:56 I'm not sure exactly why but this blog is loading

I'm not sure exactly why but this blog is loading very slow for
me. Is anyone else having this problem or is it a problem on my
end? I'll check back later on and see if the problem still exists.

# If you would like to obtain a good deal from this paragraph then you have to apply these techniques to your won weblog. 2022/03/23 2:47 If you would like to obtain a good deal from this

If you would like to obtain a good deal from this paragraph then you have to apply
these techniques to your won weblog.

# If you would like to obtain a good deal from this paragraph then you have to apply these techniques to your won weblog. 2022/03/23 2:48 If you would like to obtain a good deal from this

If you would like to obtain a good deal from this paragraph then you have to apply
these techniques to your won weblog.

# If you would like to obtain a good deal from this paragraph then you have to apply these techniques to your won weblog. 2022/03/23 2:49 If you would like to obtain a good deal from this

If you would like to obtain a good deal from this paragraph then you have to apply
these techniques to your won weblog.

# If you would like to obtain a good deal from this paragraph then you have to apply these techniques to your won weblog. 2022/03/23 2:50 If you would like to obtain a good deal from this

If you would like to obtain a good deal from this paragraph then you have to apply
these techniques to your won weblog.

# I'm amazed, I must say. Seldom do I come across a blog that's equally educative and amusing, and let me tell you, you have hit the nail on the head. The issue is something that too few people are speaking intelligently about. I'm very happy that I found 2022/03/24 4:27 I'm amazed, I must say. Seldom do I come across a

I'm amazed, I must say. Seldom do I come across a blog that's equally educative and amusing, and let me tell you, you
have hit the nail on the head. The issue is something that too few people are
speaking intelligently about. I'm very happy that I found this during my
search for something relating to this.

# It's actually a cool and useful piece of info. I am happy that you just shared this helpful info with us. Please keep us informed like this. Thanks for sharing. 2022/03/25 3:44 It's actually a cool and useful piece of info. I a

It's actually a cool and useful piece of info. I am happy that
you just shared this helpful info with us. Please keep us informed like this.
Thanks for sharing.

# Greetings! Very useful advice within this article! It's the little changes that make the most significant changes. Many thanks for sharing! 2022/06/05 23:18 Greetings! Very useful advice within this article!

Greetings! Very useful advice within this article! It's the little changes that
make the most significant changes. Many thanks for sharing!

# Wonderful, what a website it is! This web site presents valuable facts to us, keep it up. 2022/06/08 12:16 Wonderful, what a website it is! This web site pre

Wonderful, what a website it is! This web site presents valuable facts to us, keep it up.

# It's actually very difficult in this active life to listen news on Television, so I only use web for that reason, and obtain the latest information. 2022/06/10 10:49 It's actually very difficult in this active life t

It's actually very difficult in this active life to listen news on Television, so I only use web for that reason,
and obtain the latest information.

# I'm amazed, I have to admit. Rarely do I come across a blog that's both equally educative and amusing, and let me tell you, you have hit the nail on the head. The issue is something that not enough people are speaking intelligently about. I am very hap 2022/06/11 9:50 I'm amazed, I have to admit. Rarely do I come acro

I'm amazed, I have to admit. Rarely do I come
across a blog that's both equally educative and amusing, and
let me tell you, you have hit the nail on the head. The issue is something
that not enough people are speaking intelligently about.
I am very happy that I came across this during my search for
something regarding this.

# Hi there! This post couldn't be written much better! Looking at this post reminds me of my previous roommate! He always kept talking about this. I most certainly will send this article to him. Fairly certain he's going to have a very good read. I apprec 2022/06/12 0:50 Hi there! This post couldn't be written much bette

Hi there! This post couldn't be written much better!
Looking at this post reminds me of my previous roommate!
He always kept talking about this. I most certainly will send
this article to him. Fairly certain he's going to have
a very good read. I appreciate you for sharing!

# Great beat ! I would like to apprentice while you amend your website, how can i subscribe for a blog website? The account aided me a acceptable deal. I had been tiny bit acquainted of this your broadcast offered bright clear idea 2022/08/03 16:23 Great beat ! I would like to apprentice while you

Great beat ! I would like to apprentice while you amend your website, how can i subscribe
for a blog website? The account aided me a acceptable deal.
I had been tiny bit acquainted of this your broadcast
offered bright clear idea

# Great beat ! I would like to apprentice while you amend your website, how can i subscribe for a blog website? The account aided me a acceptable deal. I had been tiny bit acquainted of this your broadcast offered bright clear idea 2022/08/03 16:25 Great beat ! I would like to apprentice while you

Great beat ! I would like to apprentice while you amend your website, how can i subscribe
for a blog website? The account aided me a acceptable deal.
I had been tiny bit acquainted of this your broadcast
offered bright clear idea

# I am genuinely thankful to the owner of this web site who has shared this fantastic post at at this time. 2022/08/09 9:30 I am genuinely thankful to the owner of this web s

I am genuinely thankful to the owner of this web site who has shared
this fantastic post at at this time.

# I all the time used to study paragraph in news papers but now as I am a user of web so from now I am using net for articles, thanks to web. 2022/08/10 4:15 I all the time used to study paragraph in news pap

I all the time used to study paragraph in news papers but now as I am
a user of web so from now I am using net for articles, thanks to
web.

# When some one searches for his essential thing, so he/she desires to be available that in detail, thus that thing is maintained over here. 2022/08/13 22:33 When some one searches for his essential thing, so

When some one searches for his essential thing,
so he/she desires to be available that in detail,
thus that thing is maintained over here.

# When some one searches for his essential thing, so he/she desires to be available that in detail, thus that thing is maintained over here. 2022/08/13 22:34 When some one searches for his essential thing, so

When some one searches for his essential thing,
so he/she desires to be available that in detail,
thus that thing is maintained over here.

# When I initially commented I clicked the "Notify me when new comments are added" checkbox and now each time a comment is added I get three emails with the same comment. Is there any way you can remove me from that service? Cheers! 2022/08/15 13:03 When I initially commented I clicked the "Not

When I initially commented I clicked the "Notify me when new comments are added" checkbox and now each time
a comment is added I get three emails with the same comment.

Is there any way you can remove me from that service?
Cheers!

# You really make it seem really easy with your presentation however I to find this matter to be actually something which I think I'd never understand. It seems too complicated and extremely extensive for me. I am having a look forward on your subsequent po 2022/09/09 17:59 You really make it seem really easy with your pres

You really make it seem really easy with your presentation however I to find this
matter to be actually something which I think I'd never understand.

It seems too complicated and extremely extensive for me.
I am having a look forward on your subsequent post, I will try to get the
hold of it!

タイトル
名前
URL
コメント