Deleted articles cannot be recovered. Draft of this article would be also deleted. Are you sure you want to delete this article?
C++で副作用のない無限ループを書くと未定義動作になります。 「未定義動作」というのは口に出すだけでC++プログラマーを震え上がらせる力を持った言葉です。「鼻から悪魔が出てくる」という言葉で説明されるように、未定義動作を含むコードを実行した結果は何も保証することができず、バグの発見やデバッグすら困難にさせます。未定義動作下においてはコンパイラの気分によってコード片が消え、trueとfalseが同時に成立し、タイムトラベルを引き起こします1。 そのためC++ではうっかり未定義動作が埋め込まれないよう注意が払われるのが普通です。 さて、以下のC++のコードは未定義動作を引き起こします。 下の例は実際にclang/LLVMで最適化を有効にしてコンパイルするとでたらめな値を返す関数ができました。 この話をしたところ、何人かに驚かれたり異論を受け取ったりしたので、この話題について少しまとめてみました
Myth 1. Arithmetic in Rust is no safer than in C++Myth 2. The only strong point of Rust is object lifetime analysisMyth 3. Function calls in Rust mindlessly take up memoryMyth 4. Rust is slower than C++Myth 5. C → C++ — noop, C → Rust — PAIN!!!!!!!Myth 6. unsafe disables all Rust checksMyth 7. Rust won't help you with C librariesMyth 8. Safety of Rust hasn't been provenConclusion Spoiler: C++ isn'
In this tutorial, we will implement a Rust program that attempts to utilize 100% of the theoretical capacity of three relatively modern, mid-range CPUs. We'll use an existing, highly efficient C++ implementation as a reference point to compare how our Rust program is doing. We start with a simple baseline solution of 3 nested for-loops, and keep improving on the baseline solution incrementally, im
To write a professional C++ application, you not only need a basic text editor and a compiler. You require some more tooling. In this blog post, you’ll see a broad list of tools that make C++ programming possible: compilers, IDEs, debuggers and other. Last Update: 14th October 2019. Note: This is a blog post based on the White Paper created by Embarcadero, see the full paper here: C++ Ecosystem Wh
Our free, one-day, virtual conference for the whole C++ community Visual Studio 2019 Preview 3 introduces a new feature to reduce the binary size of C++ exception handling (try/catch and automatic destructors) on x64. Dubbed FH4 (for __CxxFrameHandler4, see below), I developed new formatting and processing for data used for C++ exception handling that is ~60% smaller than the existing implementati
「MESH: Compacting Memory Management for C/C++ Applications」という論文を読んだのでその紹介です。arXiv.org で公開されています。PLDI 2019 で採択されている論文のドラフトだそうです。私は v2 を読みました。ソースコードが GitHub (plasma-umass/Mesh) で公開されています。 免責 読み間違えている可能性があります。正確な情報が欲しい方は必ず論文を読んでください。誤りの指摘や補足、議論などは GitHub Issue や Twitter へお願いします。 読んだ動機 C/C++ でリロケーションせずにコンパクションを行う手法に興味があった。 Speedmetor 2.0 benchmark を走らせた Firefox でメモリ消費量が減ったと報告されており、ブラウザ開発者として気になった。 Ch
Today I’d like to try to explain covariance and contravariance, and the many places we see that notion pop up in C++. Covariance and contravariance, by example Consider the following veterinary analogy. We have the notion of an animal. All animals can make noise. Cats are animals. Horses are animals that you can ride. struct Animal { virtual void make_noise() = 0; virtual ~Animal() = default; }; s
Alex is a software security engineer at Mozilla, where he works on sandboxing and anti-exploitation for Firefox. Previously he was a software engineer with the United States Digital Service, and served as a member of the board of directors of both the Python and Django Software Foundations. One bug affects iPhones, another affects Windows, and the third affects servers running Linux. At first glan
Welcome to part 1 of Modern C++ for C Programmers, please see the introduction for the goals and context of this series. In this part we start with C++ features that you can use to spice up your code ’line by line’, without immediately having to use all 1400 pages of ‘The C++ Programming Language’. Various code samples discussed here can be found on GitHub. Relation between C and C++ C and C++ are
GCC (GNU Compiler Collection) A Brief History and Introduction to GCC The original GNU C Compiler (GCC) is developed by Richard Stallman, the founder of the GNU Project. Richard Stallman founded the GNU project in 1984 to create a complete Unix-like operating system as free software, to promote freedom and cooperation among computer users and programmers. GCC, formerly for "GNU C Compiler", has gr
Software is Crap Bugs, design failures, and neglected documentation. Let's do better. I know that a lot of people struggle with understanding the memory model introduced in C11/C++11. In a recent conversation I was alerted to the existence of this blog post, which while correct (by my understanding) is in my opinion aimed at those who already have a good understanding of some of the underlying con
In this post, I’ll present a small, flexible system for runtime reflection using C++11 language features. This is a system to generate metadata for C++ types. The metadata takes the form of TypeDescriptor objects, created at runtime, that describe the structure of other runtime objects. I’ll call these objects type descriptors. My initial motivation for writing a reflection system was to support s
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く