Terms of Use<\/a> and Privacy Policy<\/a>.","subscribe_button":"Subscribe"}},"identifier":"66dc5934ce6bd","campaign_id":"19717","campaign_type":"sidebar","popup_type":null,"newsletters":["developer-insider"],"behavior":{"opt_in_enabled":true},"appearance":{"colors":{"primary":"#238fee","button":{"text":"#fff","hover":{"background":"#DBDBDB","text":"#fff"},"toggle":{"background":"#238fee","text":"#
Java と DI (Dependency Injection) の世界から C++ に戻ってくると気が滅入る. すべてがくっついている. ああ... "Working Effectively With Legacy Code" に従ってバリバリと依存を引き剥がすことになるんだけれど, もうウンザリ. せめて新たに書くコードはレガシー風味とさよならしたい. DI したい. C++ にも少しは DI コンテナの実装がある. Autumn Framework とか. ただリフレクションのない C++ では DI コンテナを使う有難味が薄い. Autumn Framework のチュートリアルを見ると無力感に襲われる. 閉じた型システムの再発明. C++ の限界もあるだろうから, あまり責める気は起きない. COM のような既存のオブジェクトシステムに DI を載せることはできるかもしれない.
「C/C++ 関数・マクロ集」というタイトルですが, そのうちのいくつかはC専用だったりします.(苦笑) 2007/06/24(日) 追記 高木さんより, Cの規格上移植性に問題がある点をご指摘いただいたので, 現在修正中です. (たくさんあります….orz) とはいってもその多くは, めったにお目にかかれないような珍しい処理系とか, 「そんなの実在するの?」という処理系に移植する場合の話なので, 実用上ほとんどの場合は問題ないと思います. (一部そうとはいえないものもありますが.) Cの規格に照らして完全に「処理系・OS 非依存」 にするのは困難な場合もあり, 完璧な移植性にこだわるあまりプログラムが書けなくなっては本末転倒なので, タイトルに「ほぼ?」を入れました.orz 2007/06/21(木) 追記 このページを含め,私が C/C++ 関連記事を書くに当たりたびたび参考に&リンク
C++でコンパイラが末尾最適化を行なっているのかを判定するコードを考えてみた。 私は最初、id:higepon:20070804:1186241590のコードを思いついたのだけど、このプログラムは誤りだった。関数のなかでアドレス演算子&でアドレスをとると、そのアドレスを外部から参照されて変更とかされたときに、N回目の再帰とM回目(N!=M)の再帰とで異なるアドレス指していないと元のプログラムと等価にならない。 だから途中でアドレスをとると末尾再帰の最適化は行なわれないのだろう。 修正案は、こうだ。 #include <stdio.h> #include <stdlib.h> int* tail_rec_opt_internal(int level) { if (level == 0) return &level; return tail_rec_opt_internal(--level);
某所で「処理系が末尾再帰最適化をしているかを、処理系で動くコードから判定できるか」的な話をふったところ C/C++ なら出来そうだよねと id:yaneurao さんからツッコミが。 やってみよう。 最適化されているなら is_tail_rec_opt_internal の引数である level は再帰しないのだから常に同じアドレスにいるはずだという予想の元に判定をしている。 int is_tail_rec_opt_internal(int level, int* p) { if (0 == level) { return &level == p; } else { return is_tail_rec_opt_internal(--level, &level); } } int is_tail_rec_opt() { return is_tail_rec_opt_internal(102
Welcome to Threading Building Blocks.org! Intel® Threading Building Blocks (TBB) offers a rich and complete approach to expressing parallelism in a C++ program. It is a library that helps you take advantage of multi-core processor performance without having to be a threading expert. Threading Building Blocks is not just a threads-replacement library. It represents a higher-level, task-based parall
Over the past two decades the research community has developed a body of knowledge concerning “Lock-Free” and “Wait-Free” algorithms and data structures. These techniques allow concurrent update of shared data structures without resorting to critical sections protected by operating system managed locks. A number of wait-free and lock free algorithms for simple data structures such as LIFO stacks a
Table of contents Introduction Off-warnings Use of the functions with a variable number of arguments Magic numbers Storing of integers in double type Bit shifting operations Storing of pointer addresses Memsize types in unions Change of an array type Virtual functions with arguments of memsize type Serialization and data exchange The use of types of volatile size Ignoring
2024年3月26日 「情報的健康プロジェクト:アテンションエコノミーの暗翳と『情報的健康』−総合知で創出する健全な言論空間」を慶應義塾大&オンラインで開催されました. https://www.kgri.keio.ac.jp/news-event/156808.html 査読付き論文が出版されました.Chujyo, M., Toriumi, F. "Link-limited bypass rewiring for enhancing the robustness of complex networks". Appl Network Science Vol.9, No.17 (2024). (2024年5月) 査読付き論文が出版されました.Lai, C., Toriumi, F. & Yoshida, M. ”A multilingual analysis of pro Russian m
Captcha security check mikamama.com is for sale Please prove you're not a robot View Price Processing
Boost.Act という革命的なライブラリを発見しまし,ゾクゾクとしたのでご紹介します. Boost.Act is a C++ library which introduces STL-style algorithms that may be toggled to run in parallel or serially, and which provides tools for creating and working with parallelable algorithms, asynchronous function calls, active objects, and atomic objects, all with implementations adjustable via policies. https://boost-consulting.com:8443/trac/soc
Proudly Served by LiteSpeed Web Server at qxrunner.systest.ch Port 80
The C++ rules and recommendations in this wiki are a work in progress and reflect the current thinking of the secure coding community. Because this is a development website, many pages are incomplete or contain errors. As rules and recommendations mature, they are published in report or book form as official releases. These releases are issued as dictated by the needs and interests of the secure s
C#の場合 class Object { public int Value { get{ return mValue;} set{ mValue = value;} } private int mValue; } obj.Value = aValue; get/setメソッドの中にデバッグ出力などの処理を入れることができる。それならC++でもできる話だが,これが obj.Value = aValue; のように変数への代入のように書けるのがポイント。 これを C++でも実現できないか?というのが主題。最終的に次のようなコードを書けるようにする。 int main(int argc, char* argv[]) { A a; a.Visible = false; if (a.Visible) printf("a is visible?n"); else printf("a is n
Note: This is an unedited contribution. If this article is inappropriate, needs attention or copies someone else's work without reference then please Report This Article Download source code - 524.3 Kb Download source code - 509 Kb Introduction I have been using some samples that I have found in the codeproject now it's my turn to put in something. In this small project I am automating Exce
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く