#045 C++
My place for notes on C++ resources and references.
Notes
Just a place for notes on C++ resources and references…
Running on MacOS
Apple’s XCode ships with their LLVM release and Clang.
$ g++ --version
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
Apple LLVM version 10.0.0 (clang-1000.11.45.5)
Target: x86_64-apple-darwin17.7.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
Clang actually ships with two version of the standard library:
- Libc++, the LLVM/Clang’s standard C++ library (default)
- Libstdc++, the GNU standard C++ library that comes standard in Linux (officially deprecated)
Compilation can select the library (and C++ version) with command line switches:
g++ -std=c++17 -stdlib=libstdc++ ...
g++ -std=c++17 -stdlib=libc++ ...
Resources
- Good list of C and C++ Standards References. Selected resources:
- cppreference.com - seems to most closely follow the specs
- cplusplus.com - popular reference but seems not to have all the details from the specs
- coliru - run C/C++ in a browser; bit like fiddler for Cxx
- Toolchain versions in XCode - wikipedia