.cpp
Code
C++ソースコード
C++はCをオブジェクト指向プログラミング、テンプレート、RAII、Standard Template Library(STL)で拡張した強力なシステムプログラミング言語です。ゲームエンジン、ブラウザ、データベース、OS、高頻度取引システムに使用されています。
MIMEタイプ
text/x-c++src
種類
テキスト
圧縮
無劣化
メリット
- + High performance with zero-cost abstractions
- + Rich standard library (STL) with containers, algorithms, and iterators
- + RAII provides deterministic resource management
- + Templates enable powerful generic programming
デメリット
- − Complex language with a very steep learning curve
- − Long compilation times, especially with heavy template use
- − Manual memory management (though smart pointers help)
.CPPを使うタイミング
ゲームエンジン、リアルタイムシステム、ブラウザ、データベース、高性能と抽象化の両方が必要なソフトウェアにC++を使用してください。
技術的詳細
C++はネイティブマシンコードにコンパイルされ、手続き型、オブジェクト指向、ジェネリック(テンプレート)の複数パラダイムをサポートします。RAII(Resource Acquisition Is Initialization)がコンストラクタとデストラクタによるリソース管理を行います。
歴史
Bjarne Stroustrupは1979年にBell Labsで「C with Classes」としてC++を作成しました。1998年に標準化され(C++98)、C++11、C++14、C++17、C++20、C++23と主要なモダン機能を加えて進化しています。