C++11 เป็นมาตรฐาน C++ สมัยใหม่เผยแพร่ปี 2011 (ISO approved 12 Aug 2011) แทนที่ C++03 เรียกว่า C++0x ก่อนเผยแพร่ (x = 8 หรือ 9 คาดว่าจะเสร็จปี 2008-2009)
การเปลี่ยนแปลง/เพิ่มเติมหลักใน C++11
- Initializer lists
- Automatic type deduction (
auto) - Rvalue references & move constructors
constexpr- generalized constant expressions- ปรับนิยาม POD (Plain Old Data)
- Uniform initialization (
{}) - Range-based for loop (
for (auto x : v)) - Lambda functions & expressions
- Alternative function syntax (trailing return type)
- Explicit overrides & final
- Null pointer constant:
nullptr - Strongly typed enums (
enum class) - Right angle bracket
>>ไม่ถูกถือเป็น operator - Variadic templates
- Multithreading memory model
- Hash tables เพิ่มใน STL (
unordered_map,unordered_set) - Regular expressions ใน Standard Library (
<regex>) - Smart pointers:
shared_ptr,weak_ptr,unique_ptr
รายการเต็มและตัวอย่าง: Wikipedia C++11