Garbage Collection

塵も積もれば山

目次

Blog 利用状況

ニュース

C++とかC#とか数学ネタを投下していく予定です。

[その他のページ]
日々の四方山話を綴った日記出水の日記帳

書庫

日記カテゴリ

[C++/CLI]相互LINQ

相手がC#からSTL/CLRにアクセスするならば
こっちはC++/CLIからLINQにアクセスですよ!

まず、デフォルトではLINQクラスは見えないので、
System.Coreを参照に追加する必要があります。

これで準備完了です。
早速、テストの平均点を求めるプログラムを作ってみます。
ただし、以下の条件を追加します。

・テストの点は0点以上100点以下、それ以外のデータは除外。
・トップとビリの2人の得点は除外。

#include "stdafx.h"
using namespace System;
using namespace System::Linq;
using namespace System::Collections::Generic;
int pipe(int i){return i;}
bool valuecheck(int i){return 0 <= i && i <= 100;}
int main(array<System::String ^> ^args)
{
  List<int> ^data = gcnew List<int>();
  /* LINQをワシワシと組み立てる! */
  IEnumerable<int> ^en;
  en = Enumerable::Where<int>(data, gcnew Func<int, bool>(valuecheck));
  en = Enumerable::OrderByDescending<int, int>(en, gcnew Func<int, int>(pipe));
  en = Enumerable::Skip(en, 1);
  en = Enumerable::Reverse(en);
  en = Enumerable::Skip(en, 1);
  /* で、今更データを突っ込む */  
  array<int> ^d = gcnew array<int>{100, 60, 61, 57, 87, -1, 56, 67};
  data->AddRange(d);
  /* 残ったデータは何かな? */
  for each(int v in en){
    Console::Write(v + " ");
  }
  Console::Write("\n");
  /* 平均はどうだ? */
  Console::WriteLine("Average = " + Enumerable::Average(en));
    return 0;
}

さて、どうだ!?

どうやら成功したっぽいです。

#ぶっちゃけ、ビミョー

投稿日時 : 2008年6月26日 21:40

Feedback

# re: [C++/CLI]相互LINQ 2008/06/26 22:22 アキラ

C++ なら Range-base ライブラリを使おう、と宣伝してみる
http://d.hatena.ne.jp/faith_and_brave/20080613/1213347495

C++/CLI のことは全く考えてないですけどね

# re: [C++/CLI]相互LINQ 2008/06/27 1:17 NyaRuRu

http://d.hatena.ne.jp/NyaRuRu/20051017/p1
もっとも,これを書いたときに C++ の Range-based なライブラリや Expression Template を知っていれば,そちらを例に挙げていたと思います.

シンタックスの問題と見るなら,結局こういうところが焦点になるんじゃないでしょうかね.
http://d.hatena.ne.jp/NyaRuRu/20080316/p2

# re: [C++/CLI]相互LINQ 2008/06/27 7:59 出水

どこに落としどころをもっていくか決まらなくてですね…
なんか、もやもやっとしたものが…

遅延評価ライブラリとしてみたら機能的にいまいちで
文法的な所はVBのLINQで書いたほうがすっきりで
もやもやの原因はこの辺なのかなぁと

まぁ、LINQ自体私もよく知らないのも原因なのですが

# WpPUeJyuWEgsSJQ 2014/08/04 3:49 http://crorkz.com/

rFp9K5 I truly appreciate this post. Want more.

# HgLZziTMTOPqBs 2014/08/05 5:15 http://crorkz.com/

hZJ9DZ Im grateful for the blog article.

# aLODwidEDNVlWLB 2014/09/05 23:56 https://www.youtube.com/watch?v=bmyZcX8nn50

I do not even know how I ended up here, but I assumed this post was good. I don't realize who you might be however certainly you're going to a famous blogger for those who are not already ;) Cheers!

# zUAjRmRNzdcLWO 2014/09/09 22:01 http://www.designingdigitally.com

you've gotten a terrific weblog here! would you prefer to make some invite posts on my blog?

# iodJINHfkcxgxLTNXo 2014/09/10 19:38 http://www.nobisca.com

I will right away grasp your rss feed as I can't to find your e-mail subscription link or e-newsletter service. Do you've any? Kindly let me realize in order that I may just subscribe. Thanks.

# leSYjCwIPNwG 2014/09/16 18:43 https://www.youtube.com/watch?v=6BlpsZ7LHRQ

It's laborious to search out educated people on this subject, but you sound like you understand what you're talking about! Thanks

# pbADBatPeXRFpVxS 2014/09/17 17:08 http://www.1818-888.com

I love what you guys tend to be up too. This kind of clever work and exposure! Keep up the amazing works guys I've incorporated you guys to my blogroll.

# KUEypETmLQSIEOlYD 2014/09/18 0:06 http://youtu.be/g68g0W6gbIc

Thanks for the good writeup. It actually was a enjoyment account it. Glance complex to far added agreeable from you! By the way, how could we keep in touch?

# EzWkKJlkrjkSuA 2014/09/18 17:14 http://guccijps.info/story.php?id=29145

mIZtJw Very informative post. Keep writing.

# グッチ財布コピーコピー 2017/08/26 22:53 termbit@goo.ne.jp

ヴィトンコピー品激安販売店2017新品大SALE
ルイ・ヴィトンコピー品激安販売店の新品大SALEが開催します。
ルイヴィトン人気コピー品、コピールイヴィトン新作、ルイヴィトンダミエコピー、ルイヴィトンモノグラムコピー、コピーブランド腕時計…
いろいろ新品が続々登場します。バッグ、靴、帽子、スカーフ...
お綺麗を展示ため、ぜひおすすめの逸品です。
時間の制限がない、いつでもご愛用頂きます。
グッチ財布コピーコピー http://www.nawane111.com/panerai.htm

# ブランド腕時計 2018/09/06 7:18 pawkdhlq@docomo.ne.jp

2018年の新素材-新作
ブランド腕時計、バッグ、財布、小物などでございます専売店
★弊社は「信用第一」をモットーにお客様にご満足頂けるよう
★全物品運賃無料(日本全国)
★不良品物情況、無償で交換します.
★税関没収する商品は再度無料で発送します!

# My brother suggested I might like this blog. He was entirely right. This post actually made my day. You cann't imagine just how much time I had spent for this info! Thanks! 2018/10/05 8:43 My brother suggested I might like this blog. He wa

My brother suggested I might like this blog. He was entirely
right. This post actually made my day. You cann't
imagine just how much time I had spent for this info!
Thanks!

# I do consider all of the ideas you have presented for your post. They are very convincing and will definitely work. Nonetheless, the posts are very short for beginners. May you please extend them a bit from subsequent time? Thanks for the post. 2018/11/02 19:21 I do consider all of the ideas you have presented

I do consider all of the ideas you have presented for your post.
They are very convincing and will definitely work.
Nonetheless, the posts are very short for beginners.
May you please extend them a bit from subsequent
time? Thanks for the post.

# Wonderful beat ! I wish 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 a little bit acquainted of this your broadcast provided bright clear idea 2018/11/03 19:56 Wonderful beat ! I wish to apprentice while you am

Wonderful beat ! I wish 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 a little bit acquainted of this your broadcast provided
bright clear idea

# I really like what you guys are usually up too. This kind of clever work and exposure! Keep up the wonderful works guys I've added you guys to my blogroll. 2018/11/21 19:33 I really like what you guys are usually up too. Th

I really like what you guys are usually up too.
This kind of clever work and exposure! Keep up the wonderful works
guys I've added you guys to my blogroll.

# Just wish to say your article is as astounding. The clearness for your post is simply cool and that i can assume you're knowledgeable in this subject. Well along with your permission allow me to clutch your feed to stay up to date with forthcoming post 2019/06/07 12:19 Just wish to say your article is as astounding. Th

Just wish to say your article is as astounding. The clearness for your post
is simply cool and that i can assume you're knowledgeable in this subject.
Well along with your permission allow me to clutch your feed to stay up to date with forthcoming post.
Thanks a million and please continue the rewarding work.

# I'm really enjoying the theme/design of your weblog. Do you ever run into any internet browser compatibility problems? A handful of my blog visitors have complained about my website not operating correctly in Explorer but looks great in Opera. Do you hav 2019/06/07 23:46 I'm really enjoying the theme/design of your weblo

I'm really enjoying the theme/design of your weblog.
Do you ever run into any internet browser compatibility problems?
A handful of my blog visitors have complained about my website not
operating correctly in Explorer but looks great in Opera.
Do you have any recommendations to help fix this issue?

# What's up friends, how is the whole thing, and what you would like to say about this paragraph, in my view its truly awesome in support of me. 2019/06/13 3:16 What's up friends, how is the whole thing, and wha

What's up friends, how is the whole thing, and what you would like to say about this
paragraph, in my view its truly awesome in support of me.

# Hi! Someone in my Myspace group shared this site with us so I came to give it a look. I'm definitely loving the information. I'm bookmarking and will be tweeting this to my followers! Great blog and great style and design. 2019/07/20 21:39 Hi! Someone in my Myspace group shared this site w

Hi! Someone in my Myspace group shared this site with us so I
came to give it a look. I'm definitely loving the information. I'm
bookmarking and will be tweeting this to my followers!
Great blog and great style and design.

# My spouse and I stumbled over here different web address and thought I should check things out. I like what I see so i am just following you. Look forward to looking over your web page repeatedly. 2019/09/25 23:34 My spouse and I stumbled over here different web

My spouse and I stumbled over here different web address and thought I should check things
out. I like what I see so i am just following you. Look forward to looking over your
web page repeatedly.

# My spouse and I stumbled over here different web address and thought I should check things out. I like what I see so i am just following you. Look forward to looking over your web page repeatedly. 2019/09/25 23:35 My spouse and I stumbled over here different web

My spouse and I stumbled over here different web address and thought I should check things
out. I like what I see so i am just following you. Look forward to looking over your
web page repeatedly.

# My spouse and I stumbled over here different web address and thought I should check things out. I like what I see so i am just following you. Look forward to looking over your web page repeatedly. 2019/09/25 23:36 My spouse and I stumbled over here different web

My spouse and I stumbled over here different web address and thought I should check things
out. I like what I see so i am just following you. Look forward to looking over your
web page repeatedly.

# My spouse and I stumbled over here different web address and thought I should check things out. I like what I see so i am just following you. Look forward to looking over your web page repeatedly. 2019/09/25 23:37 My spouse and I stumbled over here different web

My spouse and I stumbled over here different web address and thought I should check things
out. I like what I see so i am just following you. Look forward to looking over your
web page repeatedly.

# ブランド商店-賢者の買物 2019/09/28 3:41 MarquisTax

ブランド商店-賢者の買物


弊社は各ランクのブランド商品満載し、ブランド通販店で一番信用のある店なので!。
品質はこちらが間違いなく保証します。
相互信頼を旨(むね)として貿易関係を結びたいのですが。
今後ともよろしくご愛顧くださいますよう、お願い申し上げます
URL:
https://www.88kopi.com/product/product-8353.html

■取扱ブランド ルイ.ヴィトン、シャネル、クリスチャン ディオール、グッチ、コーチ、ROEXL 、S品、A品、超A品
■主要取扱商品 バッグ、財布、腕時計、靴、服、ベルト、ネクタイ、ライタ!
お取り引きを開始させていただきたく思います。
詳細に関してはどうぞお気軽にご連絡ください。
https://www.88kopi.com/product/product-625.html

# ブランド偽物 2019/10/31 2:33 wcrkjlcn@docomo.ne.jp

丁寧で迅速な対応で、安心して取引できました。ショップスタッフからの自筆レターも添えられており、好感が持てます。新品品購入では情報と安心感が決め手になります。機会があったらリピートしたいショップです。
ブランド偽物 https://www.b2kopi.com/protype/list.aspx?id=234

# May I simply say what a comfort to discover a person that actually knows what they're talking about online. You definitely know how to bring an issue to light and make it important. More and more people ought to read this and understand this side of your 2019/11/15 19:02 May I simply say what a comfort to discover a pers

May I simply say what a comfort to discover a person that actually knows what they're
talking about online. You definitely know how to bring an issue to light and make it important.
More and more people ought to read this
and understand this side of your story. I can't believe you aren't more popular since you surely have the gift.

# Can you tell us more about this? I'd love to find out some additional information. 2019/11/25 21:11 Can you tell us more about this? I'd love to find

Can you tell us more about this? I'd love to find out some additional information.

# You ought to be a part of a contest for one of the finest sites online. I am going to recommend this blog! 2019/12/06 18:19 You ought to be a part of a contest for one of th

You ought to be a part of a contest for one of the finest sites online.
I am going to recommend this blog!

# 6 The second-generation Chobham The first season 0 2020/01/01 4:58 Typicalcat00

https://www.zenden.nl/%ef%bb%bfno-pay-cheapest-seniors-online-dating-site/ most secure seniors dating online sites no charge https://www.cosororecords.com/no-register-cheapest-senior-online-dating-services-blogs.wankuma.com.pdf where to meet brazilian wealthy seniors in kansas

# My spouse and I stumbled over here from a different web page and thought I may as well check things out. I like what I see so now i'm following you. Look forward to exploring your web page again. 2020/01/02 20:54 My spouse and I stumbled over here from a differe

My spouse and I stumbled over here from a different web page
and thought I may as well check things out. I like what I see so now i'm following
you. Look forward to exploring your web page again.

# My spouse and I stumbled over here from a different web page and thought I may as well check things out. I like what I see so now i'm following you. Look forward to exploring your web page again. 2020/01/02 20:55 My spouse and I stumbled over here from a differe

My spouse and I stumbled over here from a different web page
and thought I may as well check things out. I like what I see so now i'm following
you. Look forward to exploring your web page again.

# My spouse and I stumbled over here from a different web page and thought I may as well check things out. I like what I see so now i'm following you. Look forward to exploring your web page again. 2020/01/02 20:56 My spouse and I stumbled over here from a differe

My spouse and I stumbled over here from a different web page
and thought I may as well check things out. I like what I see so now i'm following
you. Look forward to exploring your web page again.

# My spouse and I stumbled over here from a different web page and thought I may as well check things out. I like what I see so now i'm following you. Look forward to exploring your web page again. 2020/01/02 20:57 My spouse and I stumbled over here from a differe

My spouse and I stumbled over here from a different web page
and thought I may as well check things out. I like what I see so now i'm following
you. Look forward to exploring your web page again.

タイトル  
名前  
Url
コメント