cppreference.com

Struct and union initialization.

When initializing an object of struct or union type, the initializer must be a non-empty, (until C23) brace-enclosed, comma-separated list of initializers for the members:

where the designator is a sequence (whitespace-separated or adjacent) of individual member designators of the form . member and array designators of the form [ index ] .

All members that are not initialized explicitly are empty-initialized .

[ edit ] Explanation

When initializing a union , the initializer list must have only one member, which initializes the first member of the union unless a designated initializer is used (since C99) .

When initializing a struct , the first initializer in the list initializes the first declared member (unless a designator is specified) (since C99) , and all subsequent initializers without designators (since C99) initialize the struct members declared after the one initialized by the previous expression.

It's an error to provide more initializers than members.

[ edit ] Nested initialization

If the members of the struct or union are arrays, structs, or unions, the corresponding initializers in the brace-enclosed list of initializers are any initializers that are valid for those members, except that their braces may be omitted as follows:

If the nested initializer begins with an opening brace, the entire nested initializer up to its closing brace initializes the corresponding member object. Each left opening brace establishes a new current object . The members of the current object are initialized in their natural order , unless designators are used (since C99) : array elements in subscript order, struct members in declaration order, only the first declared member of any union. The subobjects within the current object that are not explicitly initialized by the closing brace are empty-initialized .

If the nested initializer does not begin with an opening brace, only enough initializers from the list are taken to account for the elements or members of the member array, struct or union; any remaining initializers are left to initialize the next struct member:

[ edit ] Notes

The initializer list may have a trailing comma, which is ignored.

[ edit ] Example

Possible output:

[ edit ] References

  • C17 standard (ISO/IEC 9899:2018):
  • 6.7.9/12-39 Initialization (p: 101-105)
  • C11 standard (ISO/IEC 9899:2011):
  • 6.7.9/12-38 Initialization (p: 140-144)
  • C99 standard (ISO/IEC 9899:1999):
  • 6.7.8/12-38 Initialization (p: 126-130)
  • C89/C90 standard (ISO/IEC 9899:1990):
  • 6.5.7 Initialization

[ edit ] See also

  • Todo with reason
  • Recent changes
  • Offline version
  • What links here
  • Related changes
  • Upload file
  • Special pages
  • Printable version
  • Permanent link
  • Page information
  • In other languages
  • This page was last modified on 26 January 2023, at 04:21.
  • This page has been accessed 1,250,486 times.
  • Privacy policy
  • About cppreference.com
  • Disclaimers

Powered by MediaWiki

  • C++ Data Types
  • C++ Input/Output
  • C++ Pointers
  • C++ Interview Questions
  • C++ Programs
  • C++ Cheatsheet
  • C++ Projects
  • C++ Exception Handling
  • C++ Memory Management

Uniform Initialization in C++

  • Zero Initialization in C++
  • Problem of initialization in C++
  • Initialization of Multidimensional Arrays in C++
  • Dynamic initialization of object in C++
  • Aggregate Initialization in C++ 20
  • Temporary Materialization in C++ 17
  • Initialization of data members
  • How to Initialize 3D Vector in C++ STL?
  • std::initializer_list in C++ 11
  • When do we use Initializer List in C++?
  • Different Ways to Initialize an unordered_map in C++
  • Swift - Initialization
  • Initialization of Multidimensional Array in C
  • Initialization of static variables in C
  • Initializing a List in Java
  • Initialization of variables sized arrays in C
  • Initialization of global and static variables in C
  • How to Initialize Structures in C?
  • Implicit initialization of variables with 0 or 1 in C

Uniform initialization is a feature in C++ 11 that allows the usage of a consistent syntax to initialize variables and objects ranging from primitive type to aggregates. In other words, it introduces brace-initialization that uses braces ({}) to enclose initializer values. The syntax is as follows:

Following are some of the examples of the different ways of initializing different types:

If initialized using brace initialization, the above code can be re-written as: 

  Applications of Uniform Initialization

Initialization of dynamically allocated arrays : 

Time Complexity: O(1) Auxiliary Space: O(1)  

Initialization of an array data member of a class :

Implicitly initialize objects to return : 

Time Complexity: O(1) Auxiliary Space: O(1)

Implicitly initialize function parameter  

Please Login to comment...

Similar reads, improve your coding skills with practice.

 alt=

What kind of Experience do you want to share?

The Linux Code

A Comprehensive Guide to Initializing Structs in C++

Structs in C++ are an essential composite data structure that every C++ developer should know how to initialize properly. This in-depth guide will cover all aspects of initializing C++ structs – ranging from the fundamentals of declaring and defining structs, various initialization syntactical forms, use cases, performance considerations, pros and cons of each approach, and recommendations. By the end, you will have a comprehensive understanding of best practices for robust and efficient initialization of C++ structs.

What is a Struct in C++?

A struct in C++ allows grouping together different data types into a single user-defined data type. For example, we can define a struct to represent a 2D coordinate as:

This defines a new struct type called Point which contains two double members x and y .

Structs are similar to classes in C++, but members and inheritance are public by default instead of private. Structs are primarily used for aggregates of related data.

After defining a struct, we can declare instances of that struct:

And access members using dot syntax:

Some key properties of C++ structs:

  • Members can have different data types
  • Default access specifier for members is public
  • Support many of the same features as classes
  • Value semantics by default (copied on assignment)
  • Typically used as simple data aggregates

Next, let‘s look at different ways to initialize C++ structs.

Methods for Initializing Structs in C++

When we declare a new struct instance, its members can be left uninitialized with garbage values. For safety and correctness, we need to explicitly initialize C++ structs. Here are some common ways to initialize structs in C++ code:

1. Initializer List Initialization

An initializer list provides a way to initialize all members at the point of declaring a struct:

The initializer list {2.5, 3.7} initializes x to 2.5 and y to 3.7.

Key properties of struct initializer lists:

  • Initialize members in declaration order
  • Omitted members are default initialized
  • Useful for constants and references
  • Immutable initialization

For example:

Here, the const members x and y must be initialized in the initializer list since we can‘t modify them after initialization.

2. Assign Values After Declaration

We can separate struct declaration and initialization:

This approach is more flexible since:

  • We can initialize members in any order
  • Values can be assigned from variables or user input

But it risks uninitialized members if assignments are missed:

So additional logic is needed to handle or prevent uninitialized access.

3. Constructor Initialization

For robust and reusable initialization, we can provide a constructor for the struct:

Constructor initialization provides:

  • Guaranteed initialization of all members
  • Consistent and encapsulated init logic
  • Errors caught at compile time
  • Full flexibility in initialization order

But requires defining a dedicated constructor.

4. Uniform Initialization

C++11 introduced uniform initialization syntax using braces { } for any object:

Uniform initialization has same semantics as initializer lists, but is more concise and avoids ambiguous cases with parentheses.

5. Default Member Initialization

If we don‘t explicitly initialize members, they will be default initialized:

Built-in types like doubles are initialized to zero by default. This avoids undefined behavior from uninitialized access, but zero may not be a valid default.

Now let‘s look at some advanced initialization scenarios and considerations.

Advanced Initialization Topics

Struct member order and padding.

The order in which members are declared in a struct can impact performance and memory footprint due to padding. Members may be reordered by the compiler for correct alignment.

To minimize padding, declare members in decreasing order of size. For example:

Declaring the 4 byte int before the 8 byte double improves alignment and reduces padding.

Arrays of Structs

A common use case is an array of struct objects. We can initialize the array using a loop:

This initializes a 5 element array of Points using the loop counter.

Alternatively, we can initialize each element individually:

For large arrays, loop initialization is generally better.

Nested Struct Initialization

Structs can contain other structs as members. Nested structs require cascade initialization:

This initializes the inner struct to {2.5, 4.1} , and outer member to 3.7.

Dynamic Initialization

We can dynamically allocate structs on the heap with new :

The advantage of dynamic allocation is flexibility in initialization timing and order. But performance is better with stack allocation.

Performance Considerations

Some performance considerations for initializing C++ structs:

  • Stack vs heap : Stack allocation is faster than dynamic allocation
  • Constructor vs aggregate init : Aggregate initialization like initializer list is more efficient than constructor call overhead
  • Member padding : Optimize padding by reordering members

So where performance is critical, prefer stack allocation, aggregate initialization, and tight packing without padding through careful member ordering.

Common Use Cases for Structs

Some typical use cases for C++ structs include:

Complex numbers – Group real and imaginary components:

3D vectors – Bundle coordinates together:

Colors – Store R, G, B channels:

Statistics – Group related variables:

Structs are well suited for these kind of homogeneous aggregates. For heterogeneous data, classes are more appropriate.

Pros and Cons of Initialization Approaches

Here is a comparison of the various struct initialization methods:

Initializer lists are best for const and immutable data, but don‘t offer flexibility in order.

Assignment after declaration is most flexible but risks uninitialized members.

Constructors enforce robust initialization through encapsulation and overloading.

Uniform initialization improves code clarity compared to other brace initialization forms.

Default initialization provides a failsafe default to avoid undefined behavior, but the zero values may not be applicable.

The right choice depends on the context, requirements, and tradeoffs for a given usage.

Recommendations and Best Practices

Based on the pros, cons, andtradeoffs, here are some guidelines for initializing C++ structs:

  • Prefer constructor initialization for robustness and encapsulation
  • Use initializer lists for const members or performance-critical code
  • Initialize array elements with loops instead of individually
  • Order members by decreasing size to minimize padding
  • Avoid dynamic allocation unless flexibility is needed
  • Use default initialization as a safety net against uninitialized access bugs

Following these best practices will help write struct initialization code that is clear, robust, and efficient.

There are several ways to initialize C++ structs, including initializer lists, assignment after declaration, constructors, uniform initialization and default initialization. Each approach has benefits and downsides. For robustness, prefer constructor initialization. Initializer lists serve immutable use cases. Default initialization provides protection against undefined behavior. Carefully ordering members minimizes padding and improves performance. By mastering struct initialization best practices, we can develop high quality C++ code.

You maybe like,

Related posts, a complete guide to initializing arrays in c++.

As an experienced C++ developer, few things make me more uneasy than uninitialized arrays. You might have heard the saying "garbage in, garbage out" –…

A Comprehensive Guide to Arrays in C++

Arrays allow you to store and access ordered collections of data. They are one of the most fundamental data structures used in C++ programs for…

A Comprehensive Guide to C++ Programming with Examples

Welcome friend! This guide aims to be your one-stop resource to learn C++ programming concepts through examples. Mastering C++ is invaluable whether you are looking…

A Comprehensive Guide to Mastering Dynamic Arrays in C++

As a C++ developer, few skills are as important as truly understanding how to work with dynamic arrays. They allow you to create adaptable data…

A Comprehensive Guide to Pausing C++ Programs with system("pause") and Alternatives

As a C++ developer, having control over your program‘s flow is critical. There are times when you want execution to pause – whether to inspect…

A Comprehensive Guide to Using fgets() for Safe Input Handling in C++

As a C++ developer, you‘ll inevitably need to handle user and file input in your programs. But care must be taken to avoid common pitfalls…

This browser is no longer supported.

Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.

Brace initialization

  • 9 contributors

It isn't always necessary to define a constructor for a class , especially ones that are relatively simple. Users can initialize objects of a class or struct by using uniform initialization, as shown in the following example:

When a class or struct has no constructor, you provide the list elements in the order that the members are declared in the class . If the class has a constructor, provide the elements in the order of the parameters. If a type has a default constructor, either implicitly or explicitly declared, you can use brace initialization with empty braces to invoke it. For example, the following class may be initialized by using both empty and non-empty brace initialization:

If a class has non-default constructors, the order in which class members appear in the brace initializer is the order in which the corresponding parameters appear in the constructor, not the order in which the members are declared (as with class_a in the previous example). Otherwise, if the type has no declared constructor, member initializers must appear in the brace initializer in the same order as they're declared. In this case, you can initialize as many of the public members as you wish, but you can't skip any member. The following example shows the order that's used in brace initialization when there's no declared constructor:

If the default constructor is explicitly declared but marked as deleted, empty brace initialization can't be used:

You can use brace initialization anywhere you would typically do initialization—for example, as a function parameter or a return value, or with the new keyword:

In /std:c++17 mode and later, the rules for empty brace initialization are slightly more restrictive. See Derived constructors and extended aggregate initialization .

initializer_list constructors

The initializer_list Class represents a list of objects of a specified type that can be used in a constructor, and in other contexts. You can construct an initializer_list by using brace initialization:

To use this class, you must include the <initializer_list> header.

An initializer_list can be copied. In this case, the members of the new list are references to the members of the original list:

The standard library container classes, and also string , wstring , and regex , have initializer_list constructors. The following examples show how to do brace initialization with these constructors:

Classes and Structs Constructors

Was this page helpful?

Coming soon: Throughout 2024 we will be phasing out GitHub Issues as the feedback mechanism for content and replacing it with a new feedback system. For more information see: https://aka.ms/ContentUserFeedback .

Submit and view feedback for

Additional resources

avatar

C++ Uniform Initialization - Benefits & Pitfalls

Scott Meyer’s book, “Effective Modern C++”, has a nice section talking about uniform initialization, specifically, how to “distinguish between () and {} when creating objects”. This blog post summarizes some important tips that the author pointed out, along with some advice according to my experience and preferences.

Understanding uniform initialization in C++

Uniform initialization, since C++11 (a.k.a. modern C++ era), is the practice of using “brace initialization” {} to initialize a variable or an object. To start with a simple example, we now have at least 5 different ways to initialize an integer variable x to 1 :

Why not just use the classic int x = 1; and call it a day?

For one, we can now achieve a very consistent syntax as follows:

Another thing brace initialization solves is that it does not allow narrowing conversions. So while this would work in legacy C-style C++:

This would not work with {} (which is a good thing):

Brace initialization forces us to type-cast values explicitly like so:

Narrowing conversions can cause issues that are painful to debug. I once spent over an hour tracking down why a calculation is consistently off by a few decimals – turns out it was caused by an implicit double to int conversion deeply buried in my source code.

Another problem that uniform initialization solves is the pitfall of “most vexing parse” in C++, which is how the compiler resolves syntactic ambiguity in certain cases. The definition of “most vexing parse” goes like this: When C++ can’t distinguish between “object creation” and “function” declaration”, the compiler defaults to interpret the statement as a “function declaration”. In other words, if a line can be interpreted as a function declaration, the compiler will interpret it as a function declaration. Consider this commonly used vector definition:

Simple as it is, this will not work if we were to do this as a private member initialization!

This is because C++ will misinterpret this as a function declaration, and even complain about missing parameter declarators. There are two ways to solve this elegantly, apart from verbosely typing out std::vector v{0, 0, 0, 0, 0}; . The first way is to move the initialization to the constructor:

The second way is the use “copy initialization”, like so:

Since C++17, copy initialization like the one above is guaranteed to be optimized (no copy overhead). Even before C++17, the optimization is likely to happen, too.

Common Pitfalls of uniform initialization (brace initialization)

The first thing to look out for is when a variable declared with auto uses brace initialization, its type could be deduced to std::initializer_list (when you’re combining it with the equal sign, or if it has multiple elements). This is probably not what we intend, so we should generally avoid declaring an auto variable with an initializer list. In certain cases, it even results in an error. Here’s a comprehensive example:

The second problem especially confuses C++ beginners when they just started out using std::vectors . Notice the difference between these two statements:

As the author of “Modern Effective C++” stated, this is now viewed as a flawed design in std::vector . We should learn from this mistake and design our constructors such that “the overload called won’t be affected whether the client uses parentheses or braces.”

The third issue, and perhaps the most problematic one, is when there’s an overloading constructor that declares its parameter of type std::initializer_list . Calling a constructor with the uniform initialization syntax will “very strongly” prefer using this overload. Here’s an example to illustrate this point:

We might expect MyClass obj{5, 1.0}; to call the first constructor (the one with an int and a double as parameters), but since there’s a constructor overload that has std::initializer_list as parameter, that constructor will be “very strongly preferred”. In this case, C++ will even throw an error because it detects narrowing conversions from int and double to bool . Imagine if there’s no narrowing conversion involved (for instance, the second constructor takes in std::initializer_list<double> , the code will silently execute using the second constructor (with int 5 converted to double 5.0 in the initializer list), while the programmer thought it was using the first constructor.

The story doesn’t end here. There is one exception to this “strongly prefer std::initializer_list constructors” rule. If we instantiate an object with empty braces, and both default constructor and std::initializer_list overload constructor exist, C++ will use the default constructor. The following example showcases this exception:

If we mean to call the second constructor (with an empty initializer list), we must do it either of the following ways:

No matter which “default delimiter” (parentheses or braces) you choose, it’s always good to understand when and why we are using one. Because, as this blog pointed out, sometimes we must use one or the other. Personally I prefer to use uniform (brace) initialization wherever possible, but also acknowledge certain constructors (like std::vector ) has an overload that takes a size and initial value and we must use parentheses if we want to call that constructor. Similarly, for the C++ programmers who prefer to use parentheses wherever possible, it is important to know that there are scenarios where parentheses won’t work (for instance, in the case of “most vexing parse”).

I highly recommend reading this section in Scott Meyer’s “Effective Modern C++” book (the beginning of Chapter 3: Moving to Modern C++). On top of that, I’d also recommend reading this blog post by Herb Sutter on () vs. {} initialization.

That’s all for today, thanks for stopping by.

References:

Further reading, building an intelligent emacs.

This post introduces the combination of Emacs and LSP, and how you can make your own editor “smarter” by using the same idea of communications between an editor client and multiple language serv...

Native Emojis in Emacs

This short post will help you set up emoji support in Emacs. First, let’s see the results: Emacs showing emojis Step one, you must have an emoji font installed. I really adore the new fluent de...

Git Gutter in Emacs

When I first started programming using Visual Studio Code, I’ve benefited much from the git gutter indicators that show added/deleted/modified code blocks that haven’t been committed by git. This a...

灣區AWS軟體工程師實習心得隨筆

新版微軟雅黑,以及在 Windows 上優化中文顯示的多種技巧

Trending Tags

Learn C++

13.8 — Struct aggregate initialization

In the previous lesson ( 13.7 -- Introduction to structs, members, and member selection ), we talked about how to define structs, instantiate struct objects, and access their members. In this lesson, we’ll discuss how structs are initialized.

Data members are not initialized by default

Much like normal variables, data members are not initialized by default. Consider the following struct:

Because we have not provided any initializers, when joe is instantiated, joe.id , joe.age , and joe.wage will all be uninitialized. We will then get undefined behavior when we try to print the value of joe.id .

However, before we show you how to initialize a struct, let’s take a short detour.

What is an aggregate?

In general programming, an aggregate data type (also called an aggregate ) is any type that can contain multiple data members. Some types of aggregates allow members to have different types (e.g. structs), while others require that all members must be of a single type (e.g. arrays).

In C++, the definition of an aggregate is narrower and quite a bit more complicated.

Author’s note

In this tutorial series, when we use the term “aggregate” (or “non-aggregate”) we will mean the C++ definition of aggregate.

For advanced readers

To simplify a bit, an aggregate in C++ is either a C-style array ( 17.7 -- Introduction to C-style arrays ), or a class type (struct, class, or union) that has:

  • No user-declared constructors ( 14.9 -- Introduction to constructors )
  • No private or protected non-static data members ( 14.5 -- Public and private members and access specifiers )
  • No virtual functions ( 25.2 -- Virtual functions and polymorphism )

The popular type std::array ( 17.1 -- Introduction to std::array ) is also an aggregate.

You can find the precise definition of a C++ aggregate here .

The key thing to understand at this point is that structs with only data members are aggregates.

Aggregate initialization of a struct

Because a normal variable can only hold a single value, we only need to provide a single initializer:

However, a struct can have multiple members:

When we define an object with a struct type, we need some way to initialize multiple members at initialization time:

Aggregates use a form of initialization called aggregate initialization , which allows us to directly initialize the members of aggregates. To do this, we provide an initializer list as an initializer, which is just a braced list of comma-separated values.

There are 2 primary forms of aggregate initialization:

Each of these initialization forms does a memberwise initialization , which means each member in the struct is initialized in the order of declaration. Thus, Employee joe { 2, 28, 45000.0 }; first initializes joe.id with value 2 , then joe.age with value 28 , and joe.wage with value 45000.0 last.

Best practice

Prefer the (non-copy) braced list form when initializing aggregates.

In C++20, we can also initialize (some) aggregates using a parenthesized list of values:

We recommend avoiding this last form as much as possible, as it doesn’t currently work with aggregates that utilize brace elision (notably std::array ).

Missing initializers in an initializer list

If an aggregate is initialized but the number of initialization values is fewer than the number of members, then all remaining members are initialized with an empty initializer list. In most cases, this will perform value-initialization on those members.

In the above example, joe.id will be initialized with value 2 joe.age will be initialized with value 28 , and because joe.wage wasn’t given an explicit initializer, it will be value-initialized to 0.0 .

This means we can generally use an empty initialization list to value-initialize all members of the struct:

Const structs

Variables of a struct type can be const (or constexpr), and just like all const variables, they must be initialized.

Designated initializers C++20

When initializing a struct from a list of values, the initializers are applied to the members in order of declaration.

Now consider what would happen if you were to update this struct definition to add a new member that is not the last member:

Now all your initialization values have shifted, and worse, the compiler may not detect this as an error (after all, the syntax is still valid).

To help avoid this, C++20 adds a new way to initialize struct members called designated initializers . Designated initializers allow you to explicitly define which initialization values map to which members. The members can be initialized using list or copy initialization, and must be initialized in the same order in which they are declared in the struct, otherwise a warning or error will result. Members not designated an initializer will be value initialized.

For Clang users

When doing designated initializers of single values using braces, Clang improperly issues warning “braces around scalar initializer”. Hopefully this will be fixed soon.

Designated initializers are nice because they provide some level of self-documentation and help ensure you don’t inadvertently mix up the order of your initialization values. However, designated initializers also clutter up the initializer list significantly, so we won’t recommend their use as a best practice at this time.

Also, because there’s no enforcement that designated initializers are being used consistently everywhere an aggregate is initialized, it’s a good idea to avoid adding new members to the middle of an existing aggregate definition, to avoid the risk of initializer shifting.

When adding a new member to an aggregate, it’s safest to add it to the bottom of the definition list so the initializers for other members don’t shift.

Assignment with an initializer list

As shown in the prior lesson, we can assign values to members of structs individually:

This is fine for single members, but not great when we want to update many members. Similar to initializing a struct with an initializer list, you can also assign values to structs using an initializer list (which does memberwise assignment):

Note that because we didn’t want to change joe.id , we needed to provide the current value for joe.id in our list as a placeholder, so that memberwise assignment could assign joe.id to joe.id . This is a bit ugly.

Assignment with designated initializers C++20

Designated initializers can also be used in a list assignment:

Any members that aren’t designated in such an assignment will be assigned the value that would be used for value initialization. If we hadn’t have specified a designated initializer for joe.id , joe.id would have been assigned the value 0.

Initializing a struct with another struct of the same type

A struct may also be initialized using another struct of the same type:

The above prints:

Note that this uses the standard forms of initialization that we’re familiar with (copy, direct, or list initialization) rather than aggregate initialization.

This is most commonly seen when initializing a struct with the return value of a function that returns a struct of the same type. We cover this in more detail in lesson 13.10 -- Passing and returning structs .

guest

C++11/C++14 Uniform initialization - 2020

cplusplus_icon.png

"If you're an experienced C++ programmer and are anything like me, you initially approached C++11 thinking, "Yes, yes, I get it. It's C++, only more so." But as you learned more, you were surprised by the scope of the changes. auto declarations, range-based for loops, lambda expressions , and rvalue references change the face of C++, to say nothing of the new concurrency features. And then there are the idiomatic changes. 0 and typedefs are out, nullptr and alias declarations are in. Enums should now be scoped. Smart pointers are now preferable to built-in ones. Moving objects is normally better than copying them. - Effective Modern C++ by Scott Meyers

With C++11, everything can be initialized in much the same way.

  • Initialization of dynamically allocated arrays: int *pi = new int[5]{1, 2, 3, 4, 5};
  • Initialization of an array member variable: class A { int arr[3]; public: A(int x, int y, int z) : arr{x, y, z} { }; };
  • Initialization of a STL container: std::vector v1{1, 2};
  • Implicitly initialize objects to return: return {foo, bar};
  • Implicitly initialize a function parameter: f({foo, bar});

One thing, there are differences in terms of priorities, it's set in this order:

  • initializer_list
  • regular constructor
  • aggregate initialization

The initialization of a behaves exactly as though it were aggregate-initialization. That is, each data member of an object, in turn, will be copy-initialized with the corresponding value from the initializer-list.

Implicit type conversion will be used where necessary. If no conversion exists, or only a narrowing conversion exists, the program is ill-formed. The initialization of b invokes the constructor.

If a class has an initializer list constructor, then it takes priority over other forms of construction.

C++11/C++14 New Features

Ph.D. / Golden Gate Ave, San Francisco / Seoul National Univ / Carnegie Mellon / UC Berkeley / DevOps / Deep Learning / Visualization

YouTube

Sponsor Open Source development activities and free contents for everyone.

The Unique Burial of a Child of Early Scythian Time at the Cemetery of Saryg-Bulun (Tuva)

<< Previous page

Pages:  379-406

In 1988, the Tuvan Archaeological Expedition (led by M. E. Kilunovskaya and V. A. Semenov) discovered a unique burial of the early Iron Age at Saryg-Bulun in Central Tuva. There are two burial mounds of the Aldy-Bel culture dated by 7th century BC. Within the barrows, which adjoined one another, forming a figure-of-eight, there were discovered 7 burials, from which a representative collection of artifacts was recovered. Burial 5 was the most unique, it was found in a coffin made of a larch trunk, with a tightly closed lid. Due to the preservative properties of larch and lack of air access, the coffin contained a well-preserved mummy of a child with an accompanying set of grave goods. The interred individual retained the skin on his face and had a leather headdress painted with red pigment and a coat, sewn from jerboa fur. The coat was belted with a leather belt with bronze ornaments and buckles. Besides that, a leather quiver with arrows with the shafts decorated with painted ornaments, fully preserved battle pick and a bow were buried in the coffin. Unexpectedly, the full-genomic analysis, showed that the individual was female. This fact opens a new aspect in the study of the social history of the Scythian society and perhaps brings us back to the myth of the Amazons, discussed by Herodotus. Of course, this discovery is unique in its preservation for the Scythian culture of Tuva and requires careful study and conservation.

Keywords: Tuva, Early Iron Age, early Scythian period, Aldy-Bel culture, barrow, burial in the coffin, mummy, full genome sequencing, aDNA

Information about authors: Marina Kilunovskaya (Saint Petersburg, Russian Federation). Candidate of Historical Sciences. Institute for the History of Material Culture of the Russian Academy of Sciences. Dvortsovaya Emb., 18, Saint Petersburg, 191186, Russian Federation E-mail: [email protected] Vladimir Semenov (Saint Petersburg, Russian Federation). Candidate of Historical Sciences. Institute for the History of Material Culture of the Russian Academy of Sciences. Dvortsovaya Emb., 18, Saint Petersburg, 191186, Russian Federation E-mail: [email protected] Varvara Busova  (Moscow, Russian Federation).  (Saint Petersburg, Russian Federation). Institute for the History of Material Culture of the Russian Academy of Sciences.  Dvortsovaya Emb., 18, Saint Petersburg, 191186, Russian Federation E-mail:  [email protected] Kharis Mustafin  (Moscow, Russian Federation). Candidate of Technical Sciences. Moscow Institute of Physics and Technology.  Institutsky Lane, 9, Dolgoprudny, 141701, Moscow Oblast, Russian Federation E-mail:  [email protected] Irina Alborova  (Moscow, Russian Federation). Candidate of Biological Sciences. Moscow Institute of Physics and Technology.  Institutsky Lane, 9, Dolgoprudny, 141701, Moscow Oblast, Russian Federation E-mail:  [email protected] Alina Matzvai  (Moscow, Russian Federation). Moscow Institute of Physics and Technology.  Institutsky Lane, 9, Dolgoprudny, 141701, Moscow Oblast, Russian Federation E-mail:  [email protected]

Shopping Cart Items: 0 Cart Total: 0,00 € place your order

Price pdf version

student - 2,75 € individual - 3,00 € institutional - 7,00 €

We accept

Copyright В© 1999-2022. Stratum Publishing House

IMAGES

  1. C++ : Uniform initialization of an atomic struct?

    struct uniform initialization

  2. C++ Struct Member Initialization? 7 Most Correct Answers

    struct uniform initialization

  3. create struct c++, c++ structure initialization, access struct member

    struct uniform initialization

  4. Designated Initialization in Structures

    struct uniform initialization

  5. C# : How to perform struct inline initialization in C#?

    struct uniform initialization

  6. Lecture 13 Structs.

    struct uniform initialization

VIDEO

  1. Struct vs Enum......#coding #programming #rust #js #struct #enum

  2. Should You Use a Class, Struct or Record in C#?

  3. C++ P43 Records (structs) الجزء 43

  4. struct concept in c

  5. Create the Struct FModificationParameters

  6. C++/C programming tutorial 8: Struct, Union & Classes

COMMENTS

  1. Struct and union initialization

    When initializing a struct, the first initializer in the list initializes the first declared member (unless a designator is specified) (since C99), and all subsequent initializers without designators (since C99) initialize the struct members declared after the one initialized by the previous expression.

  2. Uniform Initialization in C++

    Uniform initialization is a feature in C++ 11 that allows the usage of a consistent syntax to initialize variables and objects ranging from primitive type to aggregates. In other words, it introduces brace-initialization that uses braces ( {}) to enclose initializer values. The syntax is as follows:

  3. c++

    8. Use list-initialization when the list is generic and you could substitute another container, such as an array, an aggregate, or a vector, without changing its meaning much. // "triplet" may be a struct, an array, or a std::vector, // but it has at least single-precision floating-point values.

  4. A Comprehensive Guide to Initializing Structs in C++

    Following these best practices will help write struct initialization code that is clear, robust, and efficient. Conclusion. There are several ways to initialize C++ structs, including initializer lists, assignment after declaration, constructors, uniform initialization and default initialization. Each approach has benefits and downsides.

  5. Brace initialization for classes, structs, and unions

    If a type has a default constructor, either implicitly or explicitly declared, you can use brace initialization with empty braces to invoke it. For example, the following class may be initialized by using both empty and non-empty brace initialization: C++. Copy. #include <string> using namespace std;

  6. C++ uniform initialization in C arrays and structs

    there is no such thing as idiomatic form.. = { 0 } was the only form of initialization allowed in C, C++11 allows empty braced list and uniform initialization struct s {}; Note that there are underwater reefs with its use, uniform initialization may do not what you expect with non-trivial classes that accept initializer_list. E.g. vector<int> v ...

  7. C++ Uniform Initialization

    Understanding uniform initialization in C++. Uniform initialization, since C++11 (a.k.a. modern C++ era), is the practice of using "brace initialization" {} to initialize a variable or an object. To start with a simple example, we now have at least 5 different ways to initialize an integer variable x to 1:

  8. PDF Lecture 3: Initialization and References

    Uniform Initialization Announcements References Const and Const References. Recap: Structs and Types. A struct is a group of named variables each with their own type. Struct Example struct Student {string name; // these are called fields string state; // separate these by semicolons int age;};

  9. 13.8

    Each of these initialization forms does a memberwise initialization, which means each member in the struct is initialized in the order of declaration. Thus, Employee joe { 2, 28, 45000.0 }; first initializes joe.id with value 2 , then joe.age with value 28 , and joe.wage with value 45000.0 last.

  10. C++ Tutorial: C++11/C++14 Uniform initialization

    If no conversion exists, or only a narrowing conversion exists, the program is ill-formed. The initialization of b invokes the constructor. If a class has an initializer list constructor, then it takes priority over other forms of construction. C++11/C++14 New Features initializer_list Uniform initialization Type Inference (auto) and Range ...

  11. Elektrostal

    Elektrostal. Elektrostal ( Russian: Электроста́ль) is a city in Moscow Oblast, Russia. It is 58 kilometers (36 mi) east of Moscow. As of 2010, 155,196 people lived there.

  12. File:Flag of Elektrostal (Moscow oblast).svg

    Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts.A copy of the license is included in the section entitled GNU Free Documentation License.

  13. Elektrostal

    In 1938, it was granted town status. [citation needed]Administrative and municipal status. Within the framework of administrative divisions, it is incorporated as Elektrostal City Under Oblast Jurisdiction—an administrative unit with the status equal to that of the districts. As a municipal division, Elektrostal City Under Oblast Jurisdiction is incorporated as Elektrostal Urban Okrug.

  14. The Unique Burial of a Child of Early Scythian Time at the Cemetery of

    Burial 5 was the most unique, it was found in a coffin made of a larch trunk, with a tightly closed lid. Due to the preservative properties of larch and lack of air access, the coffin contained a well-preserved mummy of a child with an accompanying set of grave goods. The interred individual retained the skin on his face and had a leather ...

  15. how to initialize a static struct in c++?

    The syntax is like this: struct value_t my_val = { member_a: 1, member_b: 1.2f }; This reference provides a pretty good overview of both types of initialization in the C context. Here's an excerpt that shows both the earlier (without designators) and C99 styles: When initializing a struct, the first initializer in the list initializes the first ...