Skip to main content

13 docs tagged with "cpp11"

View all tags

auto Type Deduction

auto lets the compiler deduce variable types from initializers, reducing verbosity and improving maintainability.

Chrono Library (Time)

The chrono library provides type-safe time utilities for durations, time points, and clocks. It's designed to prevent common time-related bugs through strong typing.

constexpr Functions

constexpr indicates values or functions can be evaluated at compile-time, enabling compile-time computation and optimization.

decltype

decltype deduces the type of an expression, preserving references and const qualifiers exactly.

Differences Between C++ Standards

C++ evolves through standardized versions released approximately every three years. Each standard adds features, fixes issues, and modernizes the language while maintaining backward compatibility.

glvalue, prvalue, xvalue

C++11 refined value categories into five types: lvalue, prvalue, xvalue, glvalue, and rvalue. Understanding these enables perfect forwarding and move semantics.

Lambda Expressions

Lambdas (C++11) are anonymous functions that can capture variables from surrounding scope, enabling functional programming patterns and convenient callbacks.

noexcept Specifier

noexcept specifies that a function won't throw exceptions, enabling optimizations and stronger guarantees.

std::shared_ptr

Smart pointer with shared ownership via reference counting. Multiple shared_ptrs can own the same object, deleted when last owner destroyed.

std::unique_ptr

Smart pointer with exclusive ownership. Zero overhead, automatic cleanup, move-only semantics. The default choice for dynamic memory.

std::weak_ptr

Non-owning observer of shared_ptr-managed objects. Doesn't increase reference count, enables checking if object still exists.

Uniform Initialization

C++11 brace initialization {} - one syntax for all types. Consistent, safe (prevents narrowing), solves gotchas.

Variadic Templates

Variadic templates accept any number of arguments of any types. They're the foundation for functions like std::make_tuple, printf, and perfect forwarding.