[cppll:0044] <tips>ALL_OF

Subject:
[cppll:0044] <tips>ALL_OF
From:
FUKUDA Fumiki <ffukuda@...>
Date:
Tue, 11 Dec 2001 14:20:39 +0900
X-Mailer:
WeMail32[1.42] ID:NTES00
Message-Id:
<200112110523.fBB5N3m4007963‐at‐tmg01.ntes.nec.co.jp>
In-Reply-To:
38
επιστημηです。

--- "[cppll:0038] <tips>disconst" ---
--- from "Wraith the Trickster" <wraith@...> at 2001/12/11 11:43:12 +0900 ---
>[cppll:0012] よろしくおねがいいたします】
>>よろしければぜひ皆さんのネタもご披露いただきたいと思います。
>
>投稿数が安定して流れに乗るまではみんなでネタを持ち寄った方が吉か
>と思うので、おいらもチープですが小技を紹介させていただきますー。

んじゃ僕も。実にくだらないマクロです:

#define ALL_OF(X) X.begin(), X.end()

こーやって使う。

 std::vector<int> container;
 std::ostream_iterator,int> out(cout," ");
 // '全部'プリント
 std::copy( ALL_OF(container), out);

-----:-----:-----:-----:-----:-----:-----:-----:-----:-----
FUKUDA (episteme) Fumiki -- magical, but never a magic...

スレッド

Navigation

検索

[検索ヘルプ]

Maintener: Tietew <www.tietew.jp>
Powered by Ruby on Rails, Mongrel, PostgreSQL, and Hyper Estraier.
click here