This blog describes how to pass an argument to a thread and which arguments cannot be passed. The first thing we’ll look at is why
Tag: C++
Aggregate Initialization in C++
An aggregate initialization is a collection of items gathered together. Aggregates of mixed types, such as structs and classes, are covered by this definition. An
Uniform Initialization ( List Initialization ): C++ 11
Topics Covered : Uniform Intializer list Direct list initialization Copy-list-initialization About std::initilizer_list Problem associated with std::initializer_list std::initializer_list for Aggregate
Value initialization in C++
In Value initialization the initializer is an empty pair of parenthesis.This is the major feature release in C++3.0 If user has default Constructor – it
Direct Initialization:
Direct Initialization : whenever the initialization is an argument list in parenthesis. Copy-initialization only takes into account implicit constructors and implicit user-defined conversion functions, whereas
Static initialization
Static initialization will initialized variable to 0 by default. In below example though static variable is not initialized, but still it will get initialized with
Copy Initialization in C++:
In Copy initialization an object is initialized by another object.. The following circumstances necessitate copy initialization: 1) When a named variable of non-reference type T
Default Initialization in C++
Default Initialization is the initialization performed when an object is constructed with no initializer. Default initialization occurs in three scenarios:1) when a variable with automatic,
Promise and future in C++
Content: Brief introduction of what is future and promise in C++. Sample code to implement promise and future in C++. Set an exception in promise
Use of shared_future in C++ 11
The shared_future object works similar to std::future except that it can be copied and thereby more than one std::future can share the ownership. The use