text:
C++ Language/Templates/TemplatedClasses

If a class is written as a template, then all of its members share that common abstraction, and are collectively specialized together.

Additional information about templated-classes

title: C++ Language/Templates/TemplatedClasses


text:
C++ Language/Templates/TemplatedVariables

Modern C++ can also use template syntax with any global variable (defined outside all functions). Each template-specialization will behave like a separate variable.

Additional information about templated-variables (includes interactive examples)

license: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/4.0/


text:
C++ Language/Templates/TemplateParameters

In the syntax, the placeholder symbol   is a "template-parameter". When that template gets specialized, the same datatype will be substituted in place of all instances of  in the template code.

 * 1) Default Template-Parameters
 * 2) Deducing Template-Parameters
 * 3) Variable Number of Template-Parameters


text:
C++ Language/Templates/TemplateParameters/DefaultTemplateParameters

A template-parameter may have a default. That default may be defined in terms of a previous template-parameter:.

Additional information about default template-parameters


text:
C++ Language/Templates/TemplateParameters/DeducingTemplateParameters

Traditionally, template object initialization needed to explicitly list types:. Modern C++ compilers can automatically deduce those types:.

Additional information about deducing template-parameters (includes interactive examples)


text:
C++ Language/Templates/TemplateParameters/VariableNumberOfTemplateParameters

A "variadic template" has been programmed to specialize a variable number of template-parameters:.

Additional information about variadic templates (includes interactive examples)


text:
C++ Language/Templates/Traits

A "trait" is information about some type, which is available to the compiler at compile-time (because it is expressed either as a static-data-member or as a type alias). Traits are often used to guide the decision-making within template-metaprogramming.

 * 1) Unary Predicate Traits
 * 2) Binary Predicate Traits
 * 3) Array Traits
 * 4) Unary Transform Traits
 * 5) Binary Transform Traits
 * 6) S.F.I.N.A.E. Conditional-Compilation

title: C++ Language/Templates/Traits


text:
C++ Language/Templates/Traits/UnaryPredicateTraits

A "predicate trait" is a boolean value based on some characteristic of a type. C++ provides many built-in "dummy templates" for a variety of these characteristics (e.g.,  resolves to   at compile-time).

Additional information about unary predicate traits (includes interactive examples)


text:
C++ Language/Templates/Traits/BinaryPredicateTraits

Predicate trait  tests those two types for equality (  is a platform-specific type on Win32 that is the same as  ).

Additional information about binary predicate traits


text:
C++ Language/Templates/Traits/ArrayTraits

At compile-time,  resolves to , and   resolves to.

Additional information about array traits (includes interactive examples)


text:
C++ Language/Templates/Traits/UnaryTransformTraits

A "transform trait" specifies a type that is similar to some other type, but with some added (or removed) characteristics. In this example, variable  will be a   data member for both specializations   and  :.

Additional information about unary transform traits


text:
C++ Language/Templates/Traits/BinaryTransformTraits

Transform trait  provides the coercion-result of a mixed-type-operation.

Additional information about binary transform traits


text:
C++ Language/Templates/Traits/SfinaeConditionalCompilation

Modern C++ compilers follow the "Substitution Failure is not an Error" (S.F.I.N.A.E.) principle, whereby the compiler silently eliminates a failed specialization from consideration, without that generating a compilation-error.

Additional information about the S.F.I.N.A.E. principle (includes interactive examples)


text:
C++ Language/Templates/Metaprogramming

Whereas a "program" is executed by the computer at run-time, a "metaprogram" is computation that occurs at compile-time.

 * 1) Numeric Template-Parameters
 * 2) Collection of Types

title: C++ Language/Templates/Metaprogramming


text:
C++ Language/Templates/Metaprogramming/NumericTemplateParameters

A template-parameter usually serves as a placeholder for a type. But, a template-parameter could be numeric. This gives templates a capability of performing compile-time calculations by "template-metaprograms".

Additional information about numeric template-parameters (includes interactive examples)


text:
C++ Language/Templates/Metaprogramming/CollectionOfTypes

Some template-metafunctions may compute a type (or even a collection of types) as their template-metareturn. For these template-metafunctions, the established convention is to name that result  (a nested type alias).

Additional information about a template-metafunction computing a collection of types (includes interactive examples)


text:
C++ Language/Templates/Concepts

Traditionally, a templated-function like  will allow substitution using any type (even types like   that actually shouldn't be "added together").

You can define a "concept", which is a logical criteria that only some types might satisfy:. Then we can limit allowed substitutions:.

Additional information about "concepts"

title: C++ Language/Templates/Concepts


text:
C++ Language/ErrorHandling

There are several approaches that a C++ program could take to deal with error conditions as they occur.

 * 1) Returning an Error Code
 * 2) Assertions
 * 3) C++ Exception Handling

title: C++ Language/ErrorHandling


text:
C++ Language/ErrorHandling/ReturningAnErrorCode

When a low-level feature of the operating system needs to report an error, it usually does so by returning an "error code". The Win32 platform has four built-in enumerations of error codes, which the C++ language has combined into a single  type.

Additional information about error codes (includes interactive examples)


text:
C++ Language/ErrorHandling/Assertions

The  statement is conditionally-compiled. When building a debug build-configuration, define the  preprocessor symbol so that   will evaluate its condition (aborting the software execution if that condition evaluates to  ). When building a release build-configuration, instead define the  preprocessor symbol so that   efficiently generates no machine language code.

Additional information about assertions

title: C++ Language/ErrorHandling/Assertions


text:
C++ Language/ErrorHandling/CppExceptionHandling

If some exceptionally problematic situation might occur in code (either your code or library functions that you call), enclose that code within. When your problem occurs, your code "throws an exception" by doing, and program flow will jump to the handler (even if that requires the C++ language to "unwind" a series of called functions). That data ( in this example) is an explanation for what went wrong; it is typed so you could actually program a sequence of   with   meaning "all other types".

Additional information about C++ Exception Handling


text:
C++ Language/ObsoleteFeatures

There is a formal specification of the C++ language, which has been updated every three years. The language used to contain some features, which are now considered to be obsolete.

 * 1) Trigraph Characters
 * 2) An Obsolete Smart Pointer
 * 3) Variadics before ANSI
 * 4) Obsolete Function Binding
 * 5) Boost Feature Graduation

title: C++ Language/ObsoleteFeatures


text:
C++ Language/ObsoleteFeatures/TrigraphCharacters

The preprocessor used to support weak keyboards by allowing "trigraphs" (e.g., typing  instead of  ).

Additional information about trigraph characters


text:
C++ Language/ObsoleteFeatures/ObsoleteSmartPointer

Type  is no longer used.

Additional information about auto_ptr


text:
C++ Language/ObsoleteFeatures/VariadicsBeforeAnsi

The pre-ANSI  has been replaced by.

Additional information about pre-ANSI variadics


text:
C++ Language/ObsoleteFeatures/ObsoleteFunctionBinding

Some callable-object classes and functions  are now obsolete.

Additional information about obsolete function binding


text:
C++ Language/ObsoleteFeatures/BoostFeatureGraduation

Some Boost features are now obsolete because they have been moved into the official language.

Additional information about Boost feature graduation


text:
C++ Language/Std

The "Standard Libraries" are an OS-independent set of C++ classes that should be available in any C++ development environment. These classes are within a  namespace.

 * 1) C-Runtime
 * 2) STL: Standard Template Library
 * 3) Strings
 * 4) IOStreams
 * 5) Filesystem Access
 * 6) Multithreading
 * 7) RNG: Random Number Generator

title: C++ Language/Std


text:
C++ Language/Std/Rng

The RNG from the Standard Libraries is of better quality than the obsolete implementation in the original C-Runtime.

Additional information about the standard RNG (includes interactive examples)

title: C++ Language/Std/Rng


text:
C++ Language/Std/CRuntime

The "C-Runtime" is a library that has been carried over from the C language.

 * 1) Math
 * 2) Heap Memory
 * 3) Time
 * 4) Basic Algorithms
 * 5) Executing a Shell Command

title: C++ Language/Std/CRuntime


text:
C++ Language/Std/CRuntime/Math

The C-Runtime library provides some math functions.

 * 1) Basic Math
 * 2) Trigonometry
 * 3) Rational Numbers
 * 4) Complex Numbers
 * 5) Miscellaneous Math

title: C++ Language/Std/CRuntime/Math


text:
C++ Language/Std/CRuntime/Math/BasicMath

The C-Runtime library's support for basic mathematics includes functions like,  ,  , and.

Additional information about basic math functions (includes interactive examples)


text:
C++ Language/Std/CRuntime/Math/Trigonometry

The C-Runtime includes functions like  and.

Additional information about trigonometry functions (includes interactive examples)


text:
C++ Language/Std/CRuntime/Math/RationalNumbers

Just as  is a literal form of an integer,   is a literal form of a rational number.

Additional information about rational numbers (includes interactive examples)


text:
C++ Language/Std/CRuntime/Math/ComplexNumbers

Standard C++ defines a complex number as. Compute its "phase" using, compute its "magnitude" using  , and compute its "complex conjugate" using.

Additional information about complex number functions (includes interactive examples)


text:
C++ Language/Std/CRuntime/Math/MiscellaneousMath

The C-Runtime also provides a variety of miscellaneous math functions, such as  for computing 2*3+4.

Additional information about miscellaneous math functions (includes interactive examples)


text:
C++ Language/Std/CRuntime/HeapMemory

In C++, a program's data is stored in one of two regions of system memory. Local variables and function parameters are obtained from the "memory stack", where that usage will be "popped off the stack" when the function ends. Other data can be dynamically allocated from the system's "memory heap". Heap memory will persist until it is manually deallocated.

 * 1) Allocation
 * 2) Memory Manipulation
 * 3) Leaks

title: C++ Language/Std/CRuntime/HeapMemory


text:
C++ Language/Std/CRuntime/HeapMemory/Allocation

Dynamic memory management with the C-Runtime is done by calling, which returns a pointer to the newly-allocated memory. Give that pointer to  when you are ready to deallocate that memory.

Additional information about dynamic memory allocation (includes interactive examples)


text:
C++ Language/Std/CRuntime/HeapMemory/MemoryManipulation

A whole block of memory can be set by one  function call. The  function copies a block of memory from one location to another. Two memory blocks can be lexicographically-compared by. A memory block can be searched by.

Additional information about memory manipulation functions (includes interactive examples)


text:
C++ Language/Std/CRuntime/HeapMemory/Leaks

Memory "leaks" if you forget to deallocate something that you had dynamically allocated.

Additional information about memory leaks


text:
C++ Language/Std/CRuntime/Time

The C-Runtime library provides some functions for expressing time.

 * 1) Time as a String
 * 2) Precise Time
 * 3) Timespan as CPU Clockticks

title: C++ Language/Std/CRuntime/Time


text:
C++ Language/Std/CRuntime/Time/TimeAsString

To specify a date/time, set various data members of a  object. Calling  converts that information into a string of exactly 26 characters.

The computer's current time is obtained by  as a   scalar value;   converts that scalar value into.

Additional information about encoding time in a string value (includes interactive examples)


text:
C++ Language/Std/CRuntime/Time/PreciseTime

The current time obtained by  is appropriate for uses like the timestamp of a file. But for a more precise measurement of time, set a  object to the value returned by.

Additional information about precisely measuring time (includes interactive examples)


text:
C++ Language/Std/CRuntime/Time/TimespanAsCpuClockticks

The C-Runtime keeps track of the amount of time elapsed since the library started running within your program. Query that value by calling.

Additional information about the clock function (includes interactive examples)


text:
C++ Language/Std/CRuntime/BasicAlgorithms

The C-Runtime only provides a few algorithmic functions.

 * 1) Search
 * 2) Quick Sort


text:
C++ Language/Std/CRuntime/BasicAlgorithms/Search

The C-Runtime's basic implementation of linear search by  will return   if the key does not already exist.

Binary search by  expects the input to be both sorted and unique.

Additional information about C-Runtime's search functions (includes interactive examples)


text:
C++ Language/Std/CRuntime/BasicAlgorithms/QuickSort

The C-Runtime provides a built-in  implementation of the Quick Sort algorithm.

Additional information about C-Runtime's Quick Sort implementation (includes interactive examples)


text:
C++ Language/Std/CRuntime/ExecutingShellCommand

A "system call" is the execution of a shell command, as in calling.

Additional information about system calls


text:
C++ Language/Std/Stl

The main purpose of the Standard Template Library (STL) is to provide a "collection class" for nearly any item-type.

 * 1) CollectionClasses
 * 2) Iterators
 * 3) Adapters
 * 4) Callable-Objects
 * 5) Algorithms

title: C++ Language/Std/Stl


text:
C++ Language/Std/Stl/CollectionClasses

In STL, there are many collection classes the programmer could choose from. Some of them organize their items as a linear sequence. Other collection classes organize their items based on the sorting of a "key".

 * 1) Sequence Collections
 * 2) Sorted Collections

title: C++ Language/Std/Stl/CollectionClasses


text:
C++ Language/Std/Stl/CollectionClasses/SequenceCollections

These collection classes are stored in a linear sequence from some beginning item (the "front" of the collection) to some ending item (the "back" of the collection).

 * 1) Vector
 * 2) Vector of Bool
 * 3) STL-Array
 * 4) Deque
 * 5) List
 * 6) Forward-List


text:
C++ Language/Std/Stl/CollectionClasses/SequenceCollections/Vector

A STL "vector" is a dynamically-resizing array-of-values.

 * 1) Construction
 * 2) Size
 * 3) Equality
 * 4) Indexing
 * 5) Removing Items
 * 6) Inserting Items
 * 7) Assignment


text:
C++ Language/Std/Stl/CollectionClasses/SequenceCollections/Vector/Construction

There are many ways to construct a vector, such as initializing it from a literal value using brace-syntax:.

Additional information about vector construction (includes interactive examples)


text:
C++ Language/Std/Stl/CollectionClasses/SequenceCollections/Vector/Size

STL implements a vector as having an allocation "capacity" (queried by ) that may be somewhat larger than that collection's current size (queried by  ).

Additional information about vector size (includes interactive examples)


text: Transwiki:Code

title: Transwiki:Code


text: Transwiki:Lua

title: Transwiki:Lua


text: Transwiki:Module other

title: Transwiki:Module other


text: Template:Module rating

title: Template:Module rating


text: Transwiki:Ombox

title: Transwiki:Ombox


text:
Transwiki:Documentation/styles.css

/* */ .documentation, .documentation-metadata { border: 1px solid #a2a9b1; background-color: #ecfcf4; clear: both; }

.documentation { margin: 1em 0 0 0; padding: 1em; }

.documentation-metadata { margin: 0.2em 0; /* same margin left-right as .documentation */ font-style: italic; padding: 0.4em 1em; /* same padding left-right as .documentation */ }

.documentation-startbox { padding-bottom: 3px; border-bottom: 1px solid #aaa; margin-bottom: 1ex; }

.documentation-heading { font-weight: bold; font-size: 125%; }

.documentation-clear { /* Don't want things to stick out where they shouldn't. */ clear: both; }

.documentation-toolbar { font-style: normal; font-size: 85%; }

@media screen { html.skin-theme-clientpref-night .documentation, html.skin-theme-clientpref-night .documentation-metadata { background-color: #0b1e1c; } }

@media screen and (prefers-color-scheme: dark) { html.skin-theme-clientpref-os .documentation, html.skin-theme-clientpref-os .documentation-metadata { background-color: #0b1e1c; } }

title: Transwiki:Documentation/styles.css


text:
Transwiki:Interlinear/doc

This is the module for Template:Interlinear and Template:gcl. The function invoked by the first one is p.interlinearise and the one invoked by the latter is p.gcl. See those templates' documentation for usage instructions.

Most of the glossing abbreviations are loaded from the data subpage.

title: Transwiki:Interlinear/doc


text:
C++ Language/Std/Stl/CollectionClasses/SequenceCollections/Vector/Equality

Operators  and   compare two vector objects. If you want to compare a vector to some other kind of collection, then you need to use the more general  function.

Additional information about vector equality (includes interactive examples)


text:
C++ Language/Std/Stl/CollectionClasses/SequenceCollections/Vector/Indexing

Both the C-array-operator and   allow random access to a vector's items. They differ in how they handle the error of a non-existent item. Because either of them provides a reference to that item, indexing can be used for getting it and for setting it.

A reference is also returned by the special names for the first and last items  and.

Additional information about vector indexing (includes interactive examples)


text:
C++ Language/Std/Stl/CollectionClasses/SequenceCollections/Vector/RemovingItems

The  function removes an iterator-specified item from the vector, but doesn't do anything to that removed item. So if the item-type was a pointer, then you would still be responsible for any manual destruction of the actual object.

To remove all items, use.

To remove the last item, use.

Additional information about removing items from a vector (includes interactive examples)


text:
C++ Language/Std/Stl/CollectionClasses/SequenceCollections/Vector/InsertingItems

An inserted item does not need to have the exact same item-type as the vector, as long as it can be coerced into the vector's item-type. If there will be coercion, then insertion by  will be faster than   because   directly uses a single-parameter-cast-constructor instead of copy-constructing from a compiler-temporary that holds the coerced-value.

To insert as the vector's last item, use  or.

Additional information about inserting items into a vector (includes interactive examples)


text:
C++ Language/Std/Stl/CollectionClasses/SequenceCollections/Vector/Assignment

One vector can be assigned from another vector, using the  operator.

Additional information about vector assignment (includes interactive examples)


text:
C++ Language/Std/Stl/CollectionClasses/SequenceCollections/VectorOfBool

A special specialization  compresses each item to a single bit.

For this special specialization, the indexing operator doesn't return. Instead, it returns a reference to an auxillary class that defines both  and a cast-operator for getting and setting its   value.

Additional information about a vector of bool (includes interactive examples)


text:
C++ Language/Std/Stl/CollectionClasses/SequenceCollections/StlArray

A "STL-array" (an instance of class ) has a fixed size that is part of the templated type.

Additional information about STL-arrays (includes interactive examples)


text:
C++ Language/Std/Stl/CollectionClasses/SequenceCollections/Deque

A "deque" (an instance of class ) has an array-of-values that can dynamically-resize in either direction. Unlike a vector, a deque's internal implementation does not store items in contiguous memory (so there is no "capacity"). Because a deque can grow in either direction, you can call  in addition to.

Additional information about deque (includes interactive examples)


text:
C++ Language/Std/Stl/CollectionClasses/SequenceCollections/List

A "list" (an instance of class ) is a doubly-linked-list. A list doesn't provide any random-access indexing. In order to access a particular item, you need to iterate to it.

Additional information about STL lists (includes interactive examples)


text:
C++ Language/Std/Stl/CollectionClasses/SequenceCollections/ForwardList

A "forward-list" (an instance of class ) is a forward-link-only version of a STL list. Its iteration can only use  (not  ).

Additional information about forward-list (includes interactive examples)


text:
C++ Language/Std/Stl/CollectionClasses/SortedCollections

Some STL collection classes are "sorted", in the sense that the class' items are internally stored using a tree data structure. Each item contains a "key", and the tree data structure maintains a property whereby the items are sorted by that key. As a result, client code can still iterate over the data structure from a "beginning" (item having the smallest key) to an "ending" (item having the largest key), even though that data isn't being linearly-stored. To define the sorting of keys, a sorted collection object is associated with a "sort-class" object.

 * 1) A Pair as one Item
 * 2) Tuple
 * 3) Map
 * 4) Multimap
 * 5) Set
 * 6) Multiset
 * 7) Hash-Table


text:
C++ Language/Std/Stl/CollectionClasses/SortedCollections/PairAsOneItem

A "pair" is an object whose type encapsulates two other types.

A pair has a literal form, using braces:. Access each component as  or.

Pair assignment ( operator) copies-by-value the two elements from source to destination. Usually, assignment's destination is another pair. However, pair-assignment could also use  to decompose into two scalar variables.

Additional information about std::pair (includes interactive examples)


text:
C++ Language/Std/Stl/CollectionClasses/SortedCollections/Tuple

A "tuple" is like a pair, except that a tuple can have more than two elements:. Access each component as  or   or.

Additional information about tuple (includes interactive examples)


text:
C++ Language/Std/Stl/CollectionClasses/SortedCollections/Map

A "map" is a lookup-dictionary whose items are key/value pairs.

 * 1) Construction
 * 2) Sort-Class
 * 3) Custom Sort-Class
 * 4) Size
 * 5) Equality
 * 6) Indexing
 * 7) Removing Items
 * 8) Inserting Items
 * 9) Assignment


text:
C++ Language/Std/Stl/CollectionClasses/SortedCollections/Map/Construction

Initializing a map from a literal value uses nested-brace-syntax:

Additional information about map construction


text:
C++ Language/Std/Stl/CollectionClasses/SortedCollections/Map/SortClass

The ordering of items does not matter in a map-literal. What does matter is the "sort-class" template-parameter (the default is  if omitted). The sort-class determines the actual item-ordering within STL's internal representation (by ordering their keys). When iterators use  and , they follow that sort-class order (not the map-literal's apparent order).

Additional information about specifying a sort-class (includes interactive examples)


text:
C++ Language/Std/Stl/CollectionClasses/SortedCollections/Map/CustomSortClass

You could define your own custom sort-class.

Additional information about using a custom sort-class


text:
C++ Language/Std/Stl/CollectionClasses/SortedCollections/Map/Size

The  function reports how many items are in the map. The  function reports how many items are in the map having that particular key (0 or 1 of them).

Additional information about map size (includes interactive examples)


text:
C++ Language/Std/Stl/CollectionClasses/SortedCollections/Map/Equality

Map-equality depends on the order of items in their internal-representations (due to sort-class), not on the order of items in any literal-specficiation.

Additional information about map equality (includes interactive examples)


text:
C++ Language/Std/Stl/CollectionClasses/SortedCollections/Map/Indexing

A map can be indexed-by-key (a lookup operation). Use either the C-array-operator, the  function, or the   function. These differ in how they deal with a non-existent key.

Additional information about map indexing (includes interactive examples)


text:
C++ Language/Std/Stl/CollectionClasses/SortedCollections/Map/RemovingItems

The  function removes an item from a map. You can give  either an iterator, or the key of the item that you want removed.

Additional information about removing items from a map (includes interactive examples)


text:
C++ Language/Std/Stl/CollectionClasses/SortedCollections/Map/InsertingItems

The distinction between a map's  and   functions is the same as it was for vectors. With a map, you could also use C-array-indexing syntax, which will insert a new item if the map didn't already contain one with that key.

Additional information about inserting items into a map (includes interactive examples)


text:
C++ Language/Std/Stl/CollectionClasses/SortedCollections/Map/Assignment

Assignment using the  operator will remove all existing elements.

Additional information about map assignment (includes interactive examples)


text:
C++ Language/Std/Stl/CollectionClasses/SortedCollections/Multimap

A "multimap" (an instance of class ) is the same as a map, except that multiple items are allowed to have the same key.

Additional information about multimap (includes interactive examples)


text:
C++ Language/Std/Stl/CollectionClasses/SortedCollections/Set

A "set" (an instance of class ) is the same as a map, except that each item contains only the key (there is no value).

Additional information about sets (includes interactive examples)


text:
C++ Language/Std/Stl/CollectionClasses/SortedCollections/Multiset

A "multiset" (an instance of class ) is the same as a set, except that the same item can occur multiple times.

Additional information about multiset (includes interactive examples)


text:
C++ Language/Std/Stl/CollectionClasses/SortedCollections/HashTable

The standard sorted collections each have an alternative implementation that is based on a hash-table. For example, instead of using, you might choose to use.

Additional information about hash-table-based implementations


text:
C++ Language/Std/Stl/Iterators

Various kinds of "iterators" collectively act as a common interface (designed to resemble the API of a C pointer) between multiple kinds of collection classes and multiple algorithms.

 * 1) Basic Iterators
 * 2) Ranges
 * 3) Insert-Iterators
 * 4) Reverse-Iterators
 * 5) Stream-Iterators
 * 6) Custom Iterators

title: C++ Language/Std/Stl/Iterators


text:
C++ Language/Std/Stl/Iterators/BasicIterators

An iterator is an object that reprsents a position within some collection class:

Additional information about basic iterators (includes interactive examples)


text:
C++ Language/Std/Stl/Iterators/Ranges

Often, a client uses parameters to specify a range of items to a STL algorithm. The convention is that the range's beginning is always inclusive, and its ending is always exclusive. To specify a range that involves all items, program as

Additional information about ranges of iterators

title: C++ Language/Std/Stl/Iterators/Ranges


text:
C++ Language/Std/Stl/Iterators/InsertIterators

Algorithm  has already been written by STL to call operators   and   on both source and destination iterators (overwriting destination items with data copied from source items). As such, that algorithm assumes the destination collection must already have at least as many items as the source collection.

A  "insert-iterator" is intermediary code which allows that same implementation of   to be used with an empty destination collection. That insert-iterator achieves this by re-defining the effect of operators  and. Operator  now has the effect of , and operator   now does nothing.

Additional information about insert-iterators (includes interactive examples)


text:
Talk:Java Persistence/Converting hibernate xml-mapping to JPA annotations

@Entity @Table(name = "student", indexes = { @Index(name = "number", columnList = "number", unique = true) })


text:
C++ Language/Std/Stl/Iterators/ReverseIterators

Similar to an insert-iterator, a "reverse-iterator" allows you to use STL's existing  algorithm, but changes the effect that it has because of intermediary code that re-defines the iterator's operators. In this case, the result is a "reverse-copy effect".

Additional information about reverse-iterators


text:
C++ Language/Std/Stl/Iterators/StreamIterators

Like insert-iterators and reverse-iterators, using a "stream-iterator" changes the effect of STL's existing algorithms. In this case, the iterator's  operator gets re-defined to have the effect of.

Additional information about stream-iterators (includes interactive examples)


text:
C++ Language/Std/Stl/Iterators/CustomIterators

It is possible to define your own custom iterator, by deriving from.

Additional information about custom iterators


text:
C++ Language/Std/Stl/Adapters

A "STL adapter" exposes a theoretical data structure, with its storage being internally implemented by the usage of some existing collection class.

 * 1) Stack
 * 2) Queue
 * 3) Binary-Heap

title: C++ Language/Std/Stl/Adapters


text:
C++ Language/Std/Stl/Adapters/Stack

By default,  uses a STL vector as its underlying collection class. This "stack" supports theoretical operations,  , and peeking (named  ).

Additional information about stacks (includes interactive examples)

title: C++ Language/Std/Stl/Adapters/Stack


text:
C++ Language/Std/Stl/Adapters/Queue

By default,  uses a STL deque as its underlying collection class. This "queue" supports theoretical operations  (essentially just a re-naming of  ) and   (essentially just a re-naming of  ).

Additional information about queues (includes interactive examples)

title: C++ Language/Std/Stl/Adapters/Queue


text:
C++ Language/Std/Stl/Adapters/BinaryHeap

A "binary-heap" data structure maintains the theoretical "heap-property" in a "shaped-tree" whose maximum-item is always at the tree's root. This  binary-heap is useful if you need to be able to frequently identify and remove the largest item in a collection, without that collection having been linearly-sorted.

Additional information about binary-heaps (includes interactive examples)


text:
C++ Language/Std/Stl/CallableObjects

The purpose of a "callable-object" is to abstractly refer to one specific invoke-able subroutine. A callable-object exists as an instance of.

 * 1) A Function Name as a Value
 * 2) Member Function
 * 3) Implicit Getter-Function
 * 4) Functor
 * 5) Lambda
 * 6) Generic Lambda
 * 7) Binding a new Function

title: C++ Language/Std/Stl/CallableObjects


text:
C++ Language/Std/Stl/CallableObjects/FunctionNameAsValue

The most simple form of a callable-object is the name of some existing function. If your software has already defined, then you might choose to define a callable-object as. In this case, the callable-object is a variable that can be manipulated like any other C++ variable. But the special thing about a callable-object is that it can be "invoked", either by a function-call-operator  or by.

Additional information about using a function name as a value (includes interactive examples)


text:
C++ Language/Std/Stl/CallableObjects/MemberFunction

A callable-object could also be assigned to a C++ member function:  Now, invocation requires both parameters and a   pointer (an address of some pre-existing target-object):.

Additional information about a member function being a callable-object (includes interactive examples)


text:
C++ Language/Std/Stl/CallableObjects/ImplicitGetterFunction

For every data member in a class, there is an implicit getter-function (even if the programmer didn't explicitly define that as a member function):

Additional information about implicit getter-functions (includes interactive examples)


text:
C++ Language/Std/Stl/CallableObjects/Functor

A "functor" is any object defined to have a custom overload implementation of the function-call-operator. A functor object can be assigned to any callable-object whose signature matches.

Additional information about functors (includes interactive examples)


text:
C++ Language/Std/Stl/CallableObjects/Lambda

Just like an  has a literal form (e.g.,  ), a callable-object has a literal form called a "lambda". In this example, the literal is being assigned to a callable-object variable:

Additional information about lambdas (includes interactive examples)


text:
C++ Language/Std/Stl/CallableObjects/GenericLambda

A lambda can be written in a generic way, by using  for its parameter type.

Additional information about generic lambdas (includes interactive examples)


text:
C++ Language/Std/Stl/CallableObjects/BindingNewFunction

One callable-object can be transformed into another (unnamed) callable-object by "binding" it using.

Additional information about binding a function (includes interactive examples)


text:
C++ Language/Std/Stl/Algorithms

In the context of STL, an "algorithm" is a function that has been designed to process data that's in some kind of STL collection.

 * 1) Usage with a C-Array
 * 2) Querying
 * 3) Applying Item-by-Item
 * 4) Modifying

title: C++ Language/Std/Stl/Algorithms


text:
C++ Language/Std/Stl/Algorithms/UsageWithCArray

A C-pointer implements operations (e.g., ) that some STL algorithms expect from their iterators. Thus, some algorithms (including ) allow you to use a C-array as if it were a STL collection.

Additional information about using STL algorithms with a C-array


text:
C++ Language/Std/Stl/Algorithms/Querying

A "querying" algorithm is an algorithm that computes some kind of answer, without having any side-effect on the collection data.

 * 1) Counting
 * 2) Searching
 * 3) Accumulating


text:
C++ Language/Std/Stl/Algorithms/Querying/Counting

A sorted collection has a built-in  member function that is most efficient. But for a sequence collection, you need to use the  algorithm.

Additional information about counting algorithms (includes interactive examples)


text:
C++ Language/Std/Stl/Algorithms/Querying/Searching

The algorithm  returns an iterator to the first item that it finds satisfying the callable-object (which must return a  ).

Additional information about searching algorithms (includes interactive examples)


text:
C++ Language/Std/Stl/Algorithms/Querying/Accumulating

The  algorithm iterates over items, accumulating them into a summation (or into some other kind of combination, if you provide a custom callable-object for doing each accumulation step).

Additional information about the std::accumulate algorithm (includes interactive examples)


text:
C++ Language/Std/Stl/Algorithms/ApplyingItemByItem

Some STL algorithms apply the same action over and over again, once per item in the collection.

 * 1) Processing Item-by-Item
 * 2) Ignoring Prior Values
 * 3) Item-by-Item Combination of Two Collections


text:
C++ Language/Std/Stl/Algorithms/ApplyingItemByItem/ProcessingItemByItem

If you have a function like, then you can repeatedly apply that same callable-object, once per collection item. The algorithm to do so is.

Additional information about item-by-item processing (includes interactive examples)


text:
C++ Language/Std/Stl/Algorithms/ApplyingItemByItem/IgnoringPriorValues

Unlike the  example, this function ignores existing item-values:. The algorithm to use it is.

Additional information about item-by-item processing that ignores prior values (includes interactive examples)


text:
C++ Language/Std/Stl/Algorithms/ApplyingItemByItem/ItemByItemCombinationOfTwoCollections

The  algorithm combines two collections, item-by-item.

Additional information about algorithms that combine two collections (includes interactive examples)


text:
C++ Language/Std/Stl/Algorithms/Modifying

Some STL algorithms are designed to modify a collection of items.

 * 1) Copying
 * 2) Removing
 * 3) Reordering


text:
C++ Language/Std/Stl/Algorithms/Modifying/Copying

If you have an appropriate callable-object, then copying can be conditional, with item-by-item testing of that condition:.

Additional information about copying algorithms (includes interactive examples)


text:
C++ Language/Std/Stl/Algorithms/Modifying/Removing

The  algorithm doesn't actually remove any items. Instead, it shifts the items-to-be-removed to the end of the collection. You need to call the collection class' item-removal function in order to complete the removal process.

Additional information about algorithms for the removal of items


text:
C++ Language/Std/Stl/Algorithms/Modifying/Reordering

The  algorithm uses a predicate callable-object for all of its internal comparisons between two items. That predicate defaults to.

Additional information about reordering algorithms (includes interactive examples)


text:
C++ Language/Std/Strings

A "string" is a sequence of characters, used to represent text in a C++ program.

 * 1) Unicode
 * 2) Avoiding Buffer-Overrun
 * 3) Character Categories
 * 4) C-String Manipulation
 * 5) String Class
 * 6) Casting Numeric Values
 * 7) AliasedStrings
 * 8) Regular Expressions
 * 9) Locale

title: C++ Language/Std/Strings


text:
C++ Language/Std/Strings/Unicode

An 8-bit "Ascii character" has type  (its literal values are   and , its Standard Library functions are named like  , and its Win32 functions are named like  ).

A "wide-Unicode character" has type  (its literal values are   and , its Standard Library functions are named liked  , and its Win32 functions are named like  ).

Windows programmers use preprocessor macros in  to alias either   or   (these macros are controlled by Windows' build system). That same switching mechanism also controls the expansion of macros  and.

Additional information about Unicode

title: C++ Language/Std/Strings/Unicode


text:
C++ Language/Std/Strings/AvoidingBufferOverrun

Some of the original C-Runtime functions were succeptible to a buffer-overrun-hack. For example,  would cause a runtime-error.

A safer alternative is available in Win32;  simply returns   without trying to overrun the buffer.

Additional information about avoiding buffer-overrun


text:
C++ Language/Std/Strings/CharacterCategories

There are functions for classifying a character as belonging to a category. The examples,  , and   all return true (in the form of a non-zero   value).

Additional information about character categories (includes interactive examples)


text:
C++ Language/Std/Strings/CStringManipulation

A traditional C "string" is simply an array of, where the end of the string data is terminated by a   character. That terminating character is relied upon (but not counted) when  measures that string's length to be 5.

The lexicographical ordering of two C-strings is compared by.

To copy C-string data to some other -array buffer, use   (or , which will concatenate by starting at the end of existing data).

Additional information about C-string manipulation functions (includes interactive examples)


text:
C++ Language/Std/Strings/StringClass

An object-oriented approach to storing string data is C++'s  object, which can dynamically-grow because it implements many of the same functions as an STL vector. Instead of using  to terminate string data, you can query its   function.

 * 1) Construction
 * 2) Equality
 * 3) Indexing
 * 4) Inserting Characters
 * 5) Algorithms

title: C++ Language/Std/Strings/StringClass


text:
C++ Language/Std/Strings/StringClass/Construction

A  object can be treated as a value (e.g., passing it into some function as a parameter value), because copy-construction has been provided.

Initializing a string as  is equivalent to.

Additional information about string construction (includes interactive examples)


text:
C++ Language/Std/Strings/StringClass/Equality

The  operator exists for comparing the data inside two   objects.

Additional information about string equality (includes interactive examples)


text:
C++ Language/Std/Strings/StringClass/Indexing

Like any STL collection, you could iterate through string data using. A  object uses contiguous memory for storing its characters. Application code is allowed to directly access the un-terminated character data (either via  or  ) as long as it stays within the string's allocation area, and finishes its work before the next   operation. More conveniently,  is like   except that   temporarily adds a   at the end of the data-characters (making the buffer temporarily compatible with C-Runtime functions).

Additional information about string indexing (includes interactive examples)


text:
C++ Language/Std/Strings/StringClass/InsertingCharacters

Strings have an  function (or the   operator) for appending a whole string at a time.

Additional information about inserting characters into a string (includes interactive examples)


text:
C++ Language/Std/Strings/StringClass/Algorithms

A family of  query algorithms return   (which is -1) to indicate "pattern is not found".

Additional information about string algorithms (includes interactive examples)


text:
C++ Language/Std/Strings/CastingNumericValues

A common task is the conversion of some number between two forms: its representation in a numeric data type, and a string using characters between  and.

 * 1) Number to String
 * 2) String to Number


text:
C++ Language/Std/Strings/CastingNumericValues/NumberToString

Formatted-printed by  is an easy way to cast from a number into a string.

The more modern  outputs its formatted-string as a   object.

Additional information about casting from number to string (includes interactive examples)


text:
C++ Language/Std/Strings/CastingNumericValues/StringToNumber

The inverse of formatted-printing can cast from a C-string into a numeric variable:.

Additional information about casting from string to number (includes interactive examples)


text:
C++ Language/Std/Strings/AliasedStrings

The newer  class is like , except that its copy-construction does aliasing instead of copying character data.

Additional information about aliased strings

title: C++ Language/Std/Strings/AliasedStrings


text:
C++ Language/Std/Strings/RegularExpressions

The  function compares an input string against the regular expression pattern stored in a   object. The result of that matching is output into a  object (which can be converted into a   by  ).

Additional information about regular expressions (includes interactive examples)


text:
C++ Language/Std/Strings/Locale

The behavior of some string functions will depend on the computer system's "locale" setting. The Win32 implementation of some functions (e.g., ) have a locale-sensitive alternative.

Additional information about locale

title: C++ Language/Std/Strings/Locale


text:
C++ Language/Std/Iostreams

A "stream" uses operator  to stream from general-purpose-data into a character sequence. A stream uses operator  to stream the other direction.

 * 1) Stringstream
 * 2) Streaming Custom Types

title: C++ Language/Std/Iostreams


text:
C++ Language/Std/Iostreams/Stringstream

One possible place where the character sequence could go is into a  object, which captures the character sequence as a C++ variable. That variable can then be accessed as a read-only string.

Alternatively, a character sequence can be output to the Console by streaming to.

Alternatively, a character sequence can be streamed out to a file in the filesystem.

Additional information about stringstream (includes interactive examples)

title: C++ Language/Std/Iostreams/Stringstream


text:
C++ Language/Std/Iostreams/StreamingCustomTypes

To enable  where   has a custom type, you would need to implement an overload of the stream-operator.

Additional information about streaming custom types


text:
C++ Language/Std/FilesystemAccess

A major component of the computer's operating system is its "filesystem", which stores data within "files". A C++ program can interact with that filesystem.

 * 1) Moving and Deleting
 * 2) Directories
 * 3) Binary-Files
 * 4) Formatted I/O
 * 5) Newline-Converted-Files
 * 6) Size of a File
 * 7) Redirecting stdout
 * 8) Pipes
 * 9) Console I/O
 * 10) Streamed I/O

title: C++ Language/Std/FilesystemAccess


text:
C++ Language/Std/FilesystemAccess/MovingAndDeleting

An existing directory or file can be moved by using  to change its name.

An existing directory or file can be deleted by.

Additional information about moving and deleting files


text:
C++ Language/Std/FilesystemAccess/Directories

Concatenating drive, directory, filename, and extension strings into one long path string used to be done by, but now the   can do so more elegantly (using its   operator).

Some of the most common OS shell commands have C++ versions, such as,  , and.

Additional information about directories


text:
C++ Language/Std/FilesystemAccess/BinaryFiles

A binary-standard-file is opened by  and closed by. The file has a "seek-pointer", which is the position (measured from the file's beginning) where the next  or   operation will occur. That seek-pointer could be queried by  or moved by.

Additional information about binary files


text:
C++ Language/Std/FilesystemAccess/FormattedIo

A standard-file can also use the formatted-operations  and.

Additional information about formatted I/O


text:
C++ Language/Std/FilesystemAccess/NewlineConvertedFiles

If you know that a file's data is to be interpreted as characters, then you could choose to have special operating-system-conversion of every newline character. To use that kind of "newline-converted-file", open it with  instead of.

Additional information about newline-converted-files


text:
C++ Language/Std/FilesystemAccess/SizeOfFile

There are two ways of measuring a file's size. Either call, or access the   data member of an object returned by.

Additional information about measuring the size of a file


text:
C++ Language/Std/FilesystemAccess/RedirectingStdout

The  function is useful for redirecting   to a file written on the disk.

Additional information about redirecting stdout


text:
C++ Language/Std/FilesystemAccess/Pipes

A "pipe" is like a name-less file, used for interprocess communication.

Additional information about pipes

title: C++ Language/Std/FilesystemAccess/Pipes


text:
C++ Language/Std/FilesystemAccess/ConsoleIo

The  function pauses until console-user presses a key. Then,  reads a byte from the console.

Additional information about interacting with the console


text:
C++ Language/Std/FilesystemAccess/StreamedIo

An IOStreams stream can target a file.

Additional information about streaming to a file


text:
C++ Language/Std/Multithreading

Traditionally, we think of the flow of execution through a program as being in one place at a time, flowing from one statement to the next. But it is possible for a C++ program to have multiple "threads" of execution. Each thread would act like a traditional flow of execution. Having multiple threads causes the computation of different parts of your software at essentially the same time. Each thread maintains its own local state for things like its stack of function calls.

 * 1) Thread Creation
 * 2) Critical Section
 * 3) Atomic Values
 * 4) Locks
 * 5) Events
 * 6) Return Value
 * 7) Semaphores
 * 8) Monitors and Channels

title: C++ Language/Std/Multithreading


text:
C++ Language/Std/Multithreading/MonitorsAndChannels

A "monitor" is a class that combines/encapsulates shared variables, mutually-exclusive access to those variables, and any other synchronization needed. A "channel" is a variation of a monitor; each channel is for either mutually-exclusive information-sending or mutually-exclusive information-receiving.

Additional information about monitors


text:
C++ Language/Std/Multithreading/ThreadCreation

To create a thread in modern C++, instantiate, passing it a callable-object for the worker thread's entry point.

To block yourself for an arbitrary amount of time, call. To block yourself until the worker thread has finished its work, call.

Additional information about thread creation


text:
C++ Language/Std/Multithreading/CriticalSection

A "critical section" is a code fragment that should be treated as atomic because of how it uses shared variables or resources. Extra code (inserted before and after a critical section) should enforce the mutually exclusive execution property (a.k.a. "mutex" property) within this critical section without causing "deadlock" nor "starvation".

Additional information about critical sections


text:
C++ Language/Std/Multithreading/AtomicValues

If the only content of a critical section is the manipulation of one variable, then the easiest synchronization approach would be to use  and its associated arithmetic functions.

Additional information about atomic values


text:
C++ Language/Std/Multithreading/Locks

The mutually exclusive execution property of a critical section is provided by a "lock" synchronization primitive (type  with functions   and  ). The lock maintains a record of which thread called, and only that "owner-thread" is allowed to call.

Additional information about locks (includes interactive examples)

title: C++ Language/Std/Multithreading/Locks


text:
C++ Language/Std/Multithreading/Events

An "event" is a signal communicated from one thread to another thread.

Additional information about events (includes interactive examples)

title: C++ Language/Std/Multithreading/Events


text:
C++ Language/Std/Multithreading/ReturnValue

To return a value from your worker thread, use a  return-value-getter object, whose   function will block your client thread if the worker thread hasn't yet called   on a corresponding   return-value-setter object.

Additional information about returning a value from a thread (includes interactive examples)


text:
C++ Language/Std/Multithreading/Semaphores

A "semaphore" is one kind of software technique used to synchronize between multiple threads.

 * 1) Resource Management
 * 2) Fragment Ordering
 * 3) Ring Buffer
 * 4) Readers and Writers


text:
C++ Language/Std/Multithreading/Semaphores/ResourceManagement

Multiple threads might share a limited number of resources. Now, your code fragment isn't a critical section (multiple threads can now act simultaneously), but semaphore-based synchronization is needed to manage the resource pool using  and   functions that block a thread whenever all resources have been depleted.

Additional information about using a semaphore for resource management


text:
C++ Language/Std/Multithreading/Semaphores/FragmentOrdering

A semaphore can be used to order the execution of code fragments in different threads. In this case, the "resource" isn't a physical thing, it's permission to execute the subsequent code fragment.

Additional information about using a semaphore for fragment ordering


text:
C++ Language/Std/Multithreading/Semaphores/RingBuffer

In an architecture where one thread produces a stream of products while another thread consumes those products, putting a "ring buffer" between the threads will allow variation in the pace of production and consumption.

Additional information about ring buffers


text:
C++ Language/Std/Multithreading/Semaphores/ReadersAndWriters

Semaphores provide a solution to the classic "Readers and Writers Problem", where threads are either trying to read or write a file (multiple reads can occur concurrently, but writes require exclusive access).

Additional information about the Readers and Writers problem


text:
Wikibooks:Reading room/Administrative Assistance/Archives/2022/January

Interwiki stalking/canvasing
I've been harassed through several wikis by on my talk page (including on WikiNews, WIkiquote, and several international language wikis) by an IP who is banned from Wikipedia to make edits of their liking to the Horror film article on the English Wikipedia. Their IP here was. Is there any way to lock my talk page or stop them? You can find more information about them at [Wikipedia:Sockpuppet investigations/Jinnifer/Archive this section in Wikipedia]. Thank you. Andrzejbanas (discuss • contribs) 02:46, 3 January 2022 (UTC)
 * I've blocked it one year. We could also lock your page if this is really what you want, but no other IP would be able to communicate with you. JackPotte (discuss • contribs) 08:42, 3 January 2022 (UTC)

CheckUser request posted by 96.18.219.55
Please notice "Gifnk_dlm_2020" is suspected as a sockpuppet of "Your favorite emperor". Further discussion could be found at here (requester could not edit this page so I just leave a link here). Stang (discuss • contribs) 17:14, 10 January 2022 (UTC)

 * For the record, Gifnk dlm 2020 has defended themselves on the Wikimedia Incubator. —Atcovi (Talk - Contribs) 03:48, 18 January 2022 (UTC)

Hey,block Koavf.
Ban evasion. He is indef blocked on the English Wikipedia. T. Gregtregretgtr (discuss • contribs) 00:11, 18 January 2022 (UTC)

 * T. Gregtregretgtr, Koavf being blocked on the English Wikipedia is irrelevant. He is allowed to edit on Wikibooks just like anyone else is (who is not blocked on here). With this being said, your edits are slowly becoming more disruptive to this community. This includes this nonsensical request, the additional adminship nomination for a nomination that was already closed, and the repetitive use of inappropriate language. Please re-consider the way you approach editing Wikibooks before administrative action might take place. —Atcovi (Talk - Contribs) 03:41, 18 January 2022 (UTC)
 * Ok, I thought that was ban evasion. T. Gregtregretgtr (discuss • contribs) 22:02, 24 January 2022 (UTC)


text: Category:Book:C++ Language

title: Category:Book:C++ Language


text:
User:Chr0noStqs1a

w:ja:user:Chr0noStqs1a (Home wiki) ja:user:Chr0noStqs1a (Wikibooks Home) Welcome to my Wikibooks user page. Please use the home wiki to contact me.

title: User:Chr0noStqs1a


text: Template:FULLROOTPAGENAME

title: Template:FULLROOTPAGENAME


text:
User:Ryuzaki124/sandbox

This Is A Test Of SNK Documentation

title: User:Ryuzaki124/sandbox


text:
User:Nookie23/sandbox

User:Nookie23/sandbox

title: User:Nookie23/sandbox


text:
User talk:CKWG - Ada Magica

Welcome!
Welcome to Wikibooks, CKWG - Ada Magica!

 First steps tutorial Wikibooks is for collaborative development of free textbooks.

You do not need technical skills to contribute. You can easily change most books. Please introduce yourself, and let us know what interests you.

If you already contribute at other Wikimedia projects, our Wikimedia Orientation should quickly get you started. (Would you like to provide feedback on this message?)

  Getting help   Made a mistake?   Goodies, tips and tricks
 * Read the Using Wikibooks book for a friendly introduction to the project, or our help pages for more information.
 * You can get friendly help from the community in the user assistance room or our IRC channel.
 * Upload freely licensed files to Wikimedia Commons. You may request permission to upload fair use files locally. Please include author and source information and a non-free use rationale for non-free files.
 * You can restore a previously saved version.
 * Pages should follow the  naming convention.
 * Need to rename a page? Use the move tab (is available once your account is 4 days old - until then, ask for help).
 * To request a page be deleted, add to the top of the page.
 * Was a page you made deleted? Please read the deletion policy, and check the deletion log to find out why. Also check the RFD archives if applicable. You can request undeletion at WB:RFU, or ask the administrator who deleted the page.
 * Please fill in the edit summary and preview your edits before saving.
 * Sign your name on discussion pages by typing ~~~~
 * User scripts can make many tasks easier. Look at the Gadgets tab of my preferences; check off the boxes for the scripts you want, and hit save!

Thanks for your contributions -- Jules (Mrjulesd) 06:55, 24 February 2022 (UTC)

Ada Memory Management
Hello, I've reverted your edits here because I could not find reliable sources that indicate that memory is not freed when an access type is out of scope. Memory is also freed when Storage_Size is defined so both versions work.

Hi, thank you for this note.

Finalization and deallocation are tricky. They are different things: Deallocation finalizes, however finalization does not deallocate, which I have learned via a mistake I made many years ago.

13.11(18/4) If Storage_Size is specified for an access type T, an implementation-defined pool P is used for the type... the storage for P is reclaimed when the master containing the declaration of the access type is left...

This states that storage is reclaimed when Storage_Size is given. I see that this does not say that storage is not reclaimed when Storage_Size is not given. However, there is the principle that only what is explicitly stated in the RM can be relied on.

To elaborate further:

You might point to (21.7/3) where Unchecked_Deallocation is called as part of the finalization of the collection of T. This paragraph does not apply because it talks of user-defined storage pools. Storage_Size defines an implementation-defined one (see above and (17)).

7.6.1(11.1/3) Each nonderived access type T has an associated collection, which is the set of objects created by allocators of T, or of types derived from T. Unchecked_Deallocation removes an object from its collection. Finalization of a collection consists of finalization of each object in the collection, in an arbitrary order.

This states that all remaining objects in the collection are finalized (but finalize does not deallocate). UD has to be called explicitly.

I hope this exegesis is convincing enough and that I did not overlook another important point. I'm by no means a language lawyer, but this is to my best knowledge.

Perhaps some notes about these facts should be added to the page in question. But this subject is so tricky I do not see how it could be explained more easily understandably.

CKWG - Ada Magica (discuss • contribs) 16:02, 25 February 2022 (UTC)

PS: Your reference "Dynamic memory allocation" is not up to date. I get "Sorry we can't find your page. Error 404" CKWG - Ada Magica (discuss • contribs) 16:11, 25 February 2022 (UTC)

 * Finalizers don't apply to scalar types such as strings, arrays and integers. They are simply popped out of the stack. Finalizers apply to classes.
 * Managing memory with pools is OK. It has advantages such as permiting allocation with different allocator functions on different memory regions. But you can also free memory for individual objects instead of destroying the entire pool. It is possible to dealocate memory with Unchecked_Dealocation but this method is unsafe. You can dealocate memory safely (using the default pool and default allocators) by declaring access types. Memory is freed like using alternate pools (your method) but they don't have to have spare unallocated space for each pool. M4t3uz (discuss • contribs) 21:53, 25 February 2022 (UTC)
 * Hm, I do not see what you are aiming at.
 * First of all: All objects are finalized when they go out of scope according to RM 7.6(1) - for many of them, this is just null.
 * Further: Strings, arrays and integers are not scalar types - at least in Ada. I can't speak for other languages.
 * So I had expected a reply wrt Ada RM. I can't make any sense out of your message wrt to Storage_Size. I insist on my post as it is - I do not see any conclusion of your post to the contrary. CKWG - Ada Magica (discuss • contribs) 09:41, 26 February 2022 (UTC)
 * Cut and paste error: Of course, integers are scalar. Other scalars: Floating point, fixed point, enumeration.
 * All others are composite - also access types (there is nothing in Ada saying there is a one-to-one correspondence between access values and addresses). Addresses are private, btw. 94.31.100.23 (discuss) 16:02, 26 February 2022 (UTC)

title: User talk:CKWG - Ada Magica


text: Category:Book:Carnatic Music

title: Category:Book:Carnatic Music


text: Category:Book:Carnatic Music/Templates

title: Category:Book:Carnatic Music/Templates


text:
Chess Opening Theory/1. e4/1...c6/2. Nc3/2...d5/3. Nf3/3...dxe4/4. Nxe4/4...Nf6/5. Qe2/5...Nxe4/6. Qxe4/6...Nd7/7. d4

=Caro–Kann Defence: Two Knights Attack= The most natural move in this position is /7...Nf6/, attacking the white queen.


text:
Chess Opening Theory/1. e4/1...c6/2. Nc3/2...d5/3. Nf3

= Caro–Kann Defence: Two Knights Attack =

Theory table
'''1. e4 c6 2. Nc3 d5 3. Nf3'''


text:
Cookbook:Tilapia

| Basic foodstuffs | Seafood | Fish Tilapia is a type of mild-flavored white-fleshed fish. They may be cooked whole or filleted before cooking.

title: Cookbook:Tilapia


text:
Cookbook:Crème Brûlée

Crème brûlée, also called burnt cream or Trinity cream, is a sweet baked custard topped with a layer of hard caramelized sugar. Its exact origin is debated, but it arose in Western Europe by the 17th century. It should not be confused with crème caramel.

Characteristics
The custard base of crème brûlée is richly creamy and thick-set, typically made with a milk/cream mixture, sugar, and eggs or egg yolks. This plain base can be augmented with a range of flavorings, including chocolate, vanilla, orange, coffee, etc. The caramelized sugar layer on top is amber in color and crunchy, with a nutty caramelized flavor. The thickness of the caramelized sugar can vary—some cooks will use a light touch, leaving only a few droplets of caramelized sugar on top, while others may create a thick, glass-like layer of crunchy caramelized sugar.

Custard
The custard base for crème brûlée is made by heating cream and/or milk, infusing it with any desired flavors, and tempering it into sugar and eggs/yolks. Using a high proportion of cream relative to milk yields a creamier and richer final product. Using only egg yolks, as opposed to whole eggs, also makes the custard creamier due to their fat and emulsifying lecithin content. When combining all the ingredients, over-whisking should be avoided to prevent the incorporation of excess air into the mixture.

The base is then transferred to dishes or ramekins, followed by gentle cooking/baking to carefully set the base into a smooth, creamy custard. Often a bain-marie or water bath is used to provide gentle heating.

Flavoring
Crème brûlée can be infused with a variety of flavors. Typically, solid flavorants like coffee beans, vanilla beans, tea leaves, citrus peel, chocolate, and various herbs are allowed to infuse in the hot milk/cream. Liquid extracts are usually stirred into the final custard base before baking.

Caramelized sugar
For the sugar topping, intense, direct heat is required to melt and caramelize the sugar without curdling the custard base. Historically, this was achieved by holding an extremely hot metal tool called a salamander in close proximity to the sugar. In modern cooking, a blowtorch is preferred for achieving the same controlled effect. If a blowtorch is not available, the sugar may be caramelized using the broiler feature of an oven, but this method is less precise and can lead to burning of the sugar and/or curdling of the custard.

The type of sugar used may vary, but white granulated sugar is the most typical nowadays. Superfine sugar can melt and burn too quickly, and icing sugar will dissolve and not caramelize properly. Darker sugars with higher molasses content (e.g. brown sugar) can provide a richer flavor, but they can make a stickier caramel and it's harder to judge the degree of caramelization with them.

Storage
After the custard has been baked, it must be cooled. During this period, it can be stored in the fridge or frozen for up to a month. Once the sugar topping has been added and caramelized, the finished crème brûlées do not keep well, since the topping will start to soften and dissolve.

Recipes

 * Cookbook:Crème Brûlée I
 * Cookbook:Crème Brûlée II
 * Cookbook:Crème Brûlée III

title: Cookbook:Crème Brûlée


text:
User talk:192.119.15.194

Faster than Thunder (discuss • contribs) 05:21, 25 February 2022 (UTC)

title: User talk:192.119.15.194


text:
User talk:TLSOSLT

Welcome!
Welcome to Wikibooks, TLSOSLT!

 First steps tutorial Wikibooks is for collaborative development of free textbooks.

You do not need technical skills to contribute. You can easily change most books. Please introduce yourself, and let us know what interests you.

If you already contribute at other Wikimedia projects, our Wikimedia Orientation should quickly get you started. (Would you like to provide feedback on this message?)

  Getting help   Made a mistake?   Goodies, tips and tricks
 * Read the Using Wikibooks book for a friendly introduction to the project, or our help pages for more information.
 * You can get friendly help from the community in the user assistance room or our IRC channel.
 * Upload freely licensed files to Wikimedia Commons. You may request permission to upload fair use files locally. Please include author and source information and a non-free use rationale for non-free files.
 * You can restore a previously saved version.
 * Pages should follow the  naming convention.
 * Need to rename a page? Use the move tab (is available once your account is 4 days old - until then, ask for help).
 * To request a page be deleted, add to the top of the page.
 * Was a page you made deleted? Please read the deletion policy, and check the deletion log to find out why. Also check the RFD archives if applicable. You can request undeletion at WB:RFU, or ask the administrator who deleted the page.
 * Please fill in the edit summary and preview your edits before saving.
 * Sign your name on discussion pages by typing ~~~~
 * User scripts can make many tasks easier. Look at the Gadgets tab of my preferences; check off the boxes for the scripts you want, and hit save!

Thanks for your contributions -- Jules (Mrjulesd) 09:12, 25 February 2022 (UTC)

title: User talk:TLSOSLT


text:
Rust for the Novice Programmer/Pattern Matching

Pattern Matching
So we have our AngleType enum that we created previously. Let's say we wanted to print out something explaining something about the angle. To change this based on the enum variant we encounter, we can use a match statement. For example: If the angle type is the type described in each block, then we enter that one's braces {} and ignore all the other braces. For example, if we had a points where the angle_type was acute, we would only print out the acute angle section. Also notice that since the right angle has a boolean value attached, we can use a variable called axis_aligned which gets set to whatever that value is. We can then use it inside the {} braces to print more information about the angle. Note that we match all the variants of the enum. This is a requirement of the match statement. To demonstrate this, we can match against a number in the following function: First note I don't have the {} braces on the lines. This is since we only have a single line after matching a number, so we can leave them out, but we must have the comma at the end of the line. This won't compile, since it doesn't know what to do if we get a number not 1, 2 or 6. If we want it to do nothing on receiving a number that doesn't have a fact, we can explicitly say that like so: The underscore acts as a match all, and the empty {} braces indicate we don't want to do anything in this case. We can use the underscore in other places as well. Remember our is_angle_right function from the last page? For reference, here's what it was before: This isn't valid anymore, since we could have AngleType::Right(true) or AngleType::Right(false). Instead of individually matching against both of these, we can change it to: Also, what if we want to check do something only for a specific enum variant and use the inner value(s). A convenient way to describe this pattern is using 'if let'. This is very convenient for describing this pattern and quite easy to read as well. There are many more enum and struct patterns as well as many ways to match against those patterns but these are the basic building blocks to organise and structure data in Rust.

Next: Basics of References and Borrowing


text:
Wiki Markup

Wiki markup is a markup language used by MediaWiki wikis.

Table of Contents

 * /Basic Markup Language/
 * /Templates/

title: Wiki Markup


text: Wiki Markup/Templates

title: Wiki Markup/Templates


text: Wiki Markup/Basic Markup Language

title: Wiki Markup/Basic Markup Language


text:
Cookbook:Dabeli Masala

Dabeli masala is a Gujarati blend of spices and other aromatics.

Characteristics
The blend has a laundry list of components to give it a flavor that is tangy, sweet, spiced, and hot at once. Of course, every blend is a little different, but common ingredients are coriander, fennel, cumin, cinnamon, clove, cardamom, white sesame seed, pepper, star anise, red chiles/chile powder, bay leaf, (black) salt, ginger, amchur, coconut, and sugar. Mace and turmeric may also be included, and some blends contain a little oil.

Selection and storage
Like all spice blends, dabeli masala should be kept in an airtight container. If oil is included in the blend, it's a good idea to store it in the fridge to delay its going rancid.

Use
The primary function of dabeli masala is, as the name implies, to flavor the Gujarati dish called dabeli.

title: Cookbook:Dabeli Masala


text: Wikijunior:Countries A-Z/Sierra Leone

title: Wikijunior:Countries A-Z/Sierra Leone


text: Wikijunior:Countries A-Z/Sierra Leone/Image


text: Wikijunior:Countries A-Z/Singapore

title: Wikijunior:Countries A-Z/Singapore


text: Wikijunior:Countries A-Z/Singapore/Image


text:
Annotated King Reference Manual/Statements

This page is work in progress.

Syntax
sequence_of_statements ::= statement {statement} statement ::= simple_statement | compound_statement simple_statement ::= null_statement | assignment_statement | exit_statement | procedure_call_statement | wait_statement | return_statement | end_statement compound_statement ::= if_statement | case_statement | loop_statement | declare_statement | task_declare_statement | select_statement null_statement ::= null; statement_identifier ::= direct_name

Rationale
-

Discussion
-

Syntax
assignment_statement ::=  variable_name <- expression;

Rationale
-

Discussion
-

Syntax
if_statement ::= simple_if_statement | extended_if_statement

simple_if_statement ::= if condition then sequence_of_statements [else sequence_of_statements] end if; extended_if_statement ::= if condition then sequence_of_statements else_if condition then sequence_of_statements {else_if condition then sequence_of_statements} else sequence_of_statements end if; condition ::= boolean_expression

Rationale
-

Discussion
-

Examples
-

Syntax
case_statement ::= normal_case_statement | exception_handling_case_statement

normal_case_statement ::= case selecting_expression is normal_case_statement_alternative {normal_case_statement_alternative} end case; normal_case_statement_alternative ::= when discrete_choice_list => sequence_of_statements

exception_handling_case_statement ::= case exception_identifier is exception_handling_case_statement_alternative {exception_handling_case_statement_alternative} end case; exception_handling_case_statement_alternative ::= when exception_occurrence_list => sequence_of_statements

Rationale
- Normal case statements may appear in any sequence of statements. Exception-handling case statements may only appear in an exception handler.

The exception_identifier must be the identifier following when of the enclosing exception handler.

Discussion
-

Syntax
loop_statement ::= loop_statement_identifier : [iteration_scheme] loop sequence_of_statements loop_identifier : end loop; iteration_scheme ::= for loop_parameter_specification | for loop_parameter_specification_no_reverse task | for iterator_specification [task] loop_parameter_specification ::= defining_identifier in [reverse] discrete_subtype_definition [iterator_filter] loop_parameter_specification_no_reverse ::= defining_identifier in discrete_subtype_definition [iterator_filter] discrete_subtype_definition ::= discrete_subtype_indication | range_specification iterator_specification ::= defining_identifier of iterable_name [iterator_filter] iterator_filter ::= when condition

Rationale
-

Discussion
-

Examples
-

Syntax
declare_statement ::= declare_statement_identifier: declare declarative_part declare_identifier : begin sequence_of_statements declare_identifier : when identifier => sequence_of_statements declare_identifier : end declare;

Rationale
-

Discussion
-

Examples
-

Syntax
task_declare_statement ::= task_declare_statement_identifier : task declare declarative_part task_declare_identifier : begin sequence_of_statements task_declare_identifier : and sequence_of_statements {task_declare_identifier : and sequence_of_statements} task_declare_identifier : end task declare;

Rationale
-

Discussion
-

Syntax
exit_statement ::= exit loop_name [when condition];

Rationale
-

Discussion
-

Syntax
wait_statement ::= wait wait_mode wait_expression; wait_mode ::= for | of

Rationale
The wait of statement is for a relative amount of time, and blocks the task for the number of seconds given. It can be read as, "Perform a wait of this many seconds." The wait for statement takes a Duration value and blocks the task until that time arrives, unless it is in the past. It can be read as, "Wait for this time to arrive." The duration is the number of seconds since the epoch, which is not defined, but meaningful values can be constructed using the standard library.

Discussion
-

Examples
-

Syntax
select_statement ::= select_statement_identifier : select blocking_call [sequence_of_statements] {select_identifier : or blocking_call [sequence_of_statements]} select_identifier : or wait_statement [sequence_of_statements] select_identifier : end select; blocking_call ::= assignment_statement | procedure_call_statement

Rationale
A blocking call would be a call to any subprogram of a passive task.

Discussion
-

Syntax
procedure_call_statement ::= procedure_prefix [actual_parameter_part]; actual_parameter_part ::= (parameter_association {, parameter_association}) parameter_association ::= formal_parameter_selector_name => explicit_actual_parameter explicit_actual_parameter ::= expression | variable_name

Rationale
-

Discussion
-

Syntax
return_statement ::= return [expression] [when condition];

Rationale
-

Discussion
-

Syntax
end_statement ::= end task_name;

Rationale
-

Discussion
-


text:
MediaWiki talk:Gadget-blockoptions.js

Protected edit request
Please change  to   in MediaWiki:Gadget-blockoptions.js following the rename of the internal group to suppress. See T112147 for more info. Asartea (discuss • contribs) 12:01, 27 February 2022 (UTC)
 * are you able to do this? I don't have IA access. -- Jules (Mrjulesd) 16:54, 28 February 2022 (UTC)
 * Done. Leaderboard (discuss • contribs) 19:22, 28 February 2022 (UTC)

title: MediaWiki talk:Gadget-blockoptions.js


text: Template:Gcl

title: Template:Gcl


text:
Template:Gcl/doc

This template formats a single linguistic glossing abbreviation (a grammatical category label). For example,  produces: CONT. Hovering the mouse over the abbreviation displays a tooltip with its meaning, which in this case is "continuous aspect". To specify a meaning different from the default one, pass it as a second parameter after the abbreviation itself:  gives: CONT.

The abbreviation will be rendered as a link to the relevant article if the glossing parameter is set to, thus   gives: CLF. The wikipedia article is specified by the third parameter:  gives: CLF. The presence of this third parameter (even if empty) will force the abbreviation to be displayed as a wikilink –  is equivalent to.

This template is mainly used within interlinear. It will exempt its content from the default glossing behaviour in the interlinear text. This can be needed in several circumstances: To prevent a string from being treated as a glossing label at all, use no gloss.
 * to set the meaning of an abbreviation that is otherwise not recognised;
 * to use an abbreviation with a meaning different from the default one, or linking to a different article from the default one;
 * to apply formatting to a portion of a glossing abbreviation (within interlinear this would prevent the abbreviation from being recognised);
 * to exempt an abbreviation from the default interlinear formatting. To this end, two further values of the glossing parameter can be used: no link will force the use of the default formatting as an abbreviation with a tooltip, without turning it into a wikilink; no abbr will only format the label in small caps without treating it as an abbreviation. Additional CSS styles can be set using the style parameter.

title: Template:Gcl/doc


text: Template:No gloss

title: Template:No gloss


text:
Transportation Deployment Casebook/2022

Streetcars deployed in:

Canada

 * /Alberta/
 * /British Columbia/
 * /Manitoba/
 * /New Brunswick/
 * /Nova Scotia/
 * /Ontario/
 * /Quebec/

Other Territories

 * /Puerto Rico/ (Porto Rico)

title: Transportation Deployment Casebook/2022


text:
User talk:Ardric47

Faster than Thunder (discuss • contribs) 22:08, 27 February 2022 (UTC)

title: User talk:Ardric47


text: Hindi/Phrasebook/Days of the Week

title: Hindi/Phrasebook/Days of the Week


text:
User talk:Asartea

Welcome!
Welcome to Wikibooks, Asartea!

 First steps tutorial Wikibooks is for collaborative development of free textbooks.

You do not need technical skills to contribute. You can easily change most books. Please introduce yourself, and let us know what interests you.

If you already contribute at other Wikimedia projects, our Wikimedia Orientation should quickly get you started. (Would you like to provide feedback on this message?)

  Getting help   Made a mistake?   Goodies, tips and tricks
 * Read the Using Wikibooks book for a friendly introduction to the project, or our help pages for more information.
 * You can get friendly help from the community in the user assistance room or our IRC channel.
 * Upload freely licensed files to Wikimedia Commons. You may request permission to upload fair use files locally. Please include author and source information and a non-free use rationale for non-free files.
 * You can restore a previously saved version.
 * Pages should follow the  naming convention.
 * Need to rename a page? Use the move tab (is available once your account is 4 days old - until then, ask for help).
 * To request a page be deleted, add to the top of the page.
 * Was a page you made deleted? Please read the deletion policy, and check the deletion log to find out why. Also check the RFD archives if applicable. You can request undeletion at WB:RFU, or ask the administrator who deleted the page.
 * Please fill in the edit summary and preview your edits before saving.
 * Sign your name on discussion pages by typing ~~~~
 * User scripts can make many tasks easier. Look at the Gadgets tab of my preferences; check off the boxes for the scripts you want, and hit save!

Thanks for your contributions -- Jules (Mrjulesd) 16:52, 28 February 2022 (UTC)

title: User talk:Asartea


text:
Guide to the Godot game engine

This book will teach you about the free and open source Godot engine. Godot, like Unreal, Unity and other common game engines, has an active community. However, Godot is free, less demanding on operating systems, so you can use it on older hardware, and you can "export" your game to various systems, including mobile, in a single mouse click. It may be free, but it's not lacking in any way.

Godot was named after the play, Waiting for Godot, as it represents a never-ending wish to add more features, which would make it closer to a exhaustive product.

What even is Godot?
Godot is, like explained above, an open-source game engine. The advantage of being open-source is Anybody can edit its source code! If it doesn't do quite what you need it to do, just crack it open and see what new tools you can make. If it's good enough, you can even submit the code to be part of the next official update! Another advantage is what you make (be it an app or a game or a plugin) is completely yours! No strings attached, no royalties, no limitation of license... Exactly how game development should be!

However, console-specific code cannot be compiled with open-source code. You need to pay somebody else who can compile it for you, and this can be costly. Then-again, most engines have the same issue. And several games made with this engine have been released onto a console.

In addition, Godot's API is not like most game engines, where you can find things like "entities" and "props". Everything is done with nodes, Godot's building blocks, which can be put together in many ways to get your entity or prop. Each node may also have a script. While highly flexible, it has some performance cost.

Godot has many nodes, but this book is not the place to list each and every one. That's what Godot's official class reference is for. This book will focus on what Godot is, help you achieve your goals and provide helpful links for those who want more info can go to.

What inspired me to start this book?
I was shocked that Wikibooks had no Godot guides. It had guides for Ada, LolGraphics, C++, C#, HTML, JavaScript and more, but not one on either Godot or a game engine (not that I could find anyway).

Godot guides out there had very little I didn't know, and some were books that cost... money. Well, a wiki's belief is that all information should be free.

title: Guide to the Godot game engine


text:
Making Websites with Flask/Routing

What is Routing?
Routing basically means returning something to the user when they visit a specific URL on the site, which is called a route. In the Getting Started tutorial, we had two routes: the root route,, and.

URL Building with Route Variables
URL building is the practice of having dynamically served URLs, that are not built in. An example of this would be if you had a  route, but the URL was formatted like. In a Flask app without route variables, you would manually need to add each user with  many times, but with Route Variables you can just say , and you can show the account page.

title: Making Websites with Flask/Routing


text:
Guide to the Godot game engine/What is a node

Nodes are the building blocks of Godot. They can be combined into trillions of different combinations. There are many different types of nodes, like and.

Every node goes under this one. It is the basic node that defines all others. See it as the parent and the grandparent of Godot and its nodes, and all the games that Godot has been used in. It stores common things like name and script. It can be used instead of or  when making objects that store data, and are not needed to be shown on the screen or have a position.

CanvasItem
Unlike Node, Canvas Items are positional, and implement draw code. They are used for all 2D objects, and have two main node types that inherit it:

Used for the GUI. It contains options like whether to ignore mouse input, receive it and let it pass to other UI, or receive it and stop it reaching other UI. They also allow margins and anchors, allowing a Control node to stay in a certain part of the screen or stretch when the window expands or shrinks.

These are used for 2D game elements, like and. They are drawn on the canvas, which is drawn on top of the 3D view. Well, its actually the other way around. 3D is actually drawn in the background of the canvas, if there is an active Camera3D in the scene.

Used for 3D game elements. They store positional data, rotation, and scale. They do not draw onto the screen. For this, you need to use the node that inherits Spatial. You need an enabled Camera3D in the scene to actually see the 3D world.

Making custom nodes
Firstly, you need to decide what it'll do. Is it some variant of ? Or is it a custom ?

After you decided what it does, you must decide what Node it inherits. This is important. You don't want to use Control if you want a 3D button, or Spatial for a timer.

In my opinion, this is the recommended node for each type of object you want to make:

Node: Use for objects that won't be part of the GUI, 2D or 3D worlds. Existing examples are Timers, and.

Node2D: Objects for games that are not used in the GUI. There are exceptions, but in general, don't mix up Node2D and Control too much.

Control: For GUI, like menus, HUDs and certain game elements that require anchors and margins.

Spatial: Used only for 3D.

For more on making nodes, please see Making nodes.

Inheritance
Each node has several properties. Like Node with its name property, or Node2D with positional data. Every node that inherits it gains the properties of it. A brief example:

 * Node: name, script, others
 * Spatial: properties of Node; position; rotation; scale, others
 * CanvasItem: properties of Node; visibility; others
 * Node2D: properties of CanvasItem and of Node; position; rotation; scale; others
 * Control: properties of CanvasItem and of Node; rect position, size and scale; rotation; others
 * properties of Control, CanvasItem and Node; color

SceneTree
Godot has building blocks, yes, but what's the glue that sticks it all together?

The SceneTree is the glue, and it's a strong glue. But it is also a flexible glue. It is an  (which is the great-great grandfather/mother of all Godot "things").

The SceneTree is where everything happens. Nodes process in a certain order, draw on the screen, and more.

When making your game, each menu, every level, and every object are all scenes. You save them on the file system (or "fs" for short), and can then put those scenes within scenes. You could make an enemy scene, save it, then put it in your "level 1" scene as many times as you like. This is called instancing a scene.

Inheriting a scene can be considered the opposite to instancing. An inherited scene is like a copy of a scene, but with limited freedom to make modifications. This is useful to have a base enemy scene, then inherit it for each enemy you add, and make your modifications. This keeps your enemies consistent, and makes each file easier to understand. This is quite similar to inheriting a node, except that multiple nodes are inherited instead of making a new inherited script.

If, for example, on "Level 6", you have to fight a mutant version of a common enemy found throughout the game. You want to use it only once in the entire game, so is not worth inheriting the enemy scene and making a whole new file for an enemy used only once. Instead, while on level 6, right click on the enemy you want to modify in the Scene dock. Check the "editable children" box, and make your modifications. It is almost exactly the same as inheriting the scene, except that you are not making a new file.

If you decide that the mutant enemy would do well on other levels, or you use it more than once in a single level, left click on the enemy on the Scene dock and click "save branch as scene". This will save the node as a scene a with your modifications to be reused on any other level.

Adding a node
Okay, so now you know what you can do, how do you do any of it?

Lets create a simple scene. Open the Godot project manager. On the left is a list of buttons. Click New Project. A popup should appear. Press Browse under "Project Path:" and choose what folder to store your game. It's a good idea to have all your games in the same folder so they can be easily accessed. Once that is done, press "Create Folder", type something like "Godot test project", and click OK. Then click "Select Current Folder", and.

Now Godot should open. On the left, there should be a Scene dock with a few buttons on it. Click. Double click the bit that says "Control" and rename it to.

Now, press the white "+" icon in that dock, and a popup should appear. In the search bar, type. Double click the highlighted menu item for.

On the left, in the Inspector dock, look for the property. Type  (Make sure your Label is selected on the Scene dock). At the top of the screen is a  button. Click it. A drop down menu will appear with many options. Press Center. The "Hello world!" text appears at the center of the blue box in the 2D viewport (the large bit in the middle of the editor).

Now you know how to add a node, how do you delete them if you make a mistake? The fastest way is to undo (press "Control+z" on Windows). If the node is not recently created, instead left-click on it in the Scene dock. Click. If you delete a node you didn't want to delete, just press undo. If you press undo too many times, you can redo ("Control+Shift+Z" on Windows).

Now save your scene with "Control+S". Don't change the file name. You can also save to a different scene with "Control+Shift+S".

Instancing and editable children
To save a node and its children as a separate scene file, left click on the node and click. For this experiment, do so on your Label. The file name should be. Press "Save".

Find your Label scene but do not open it. Drag and drop it over your "Test UI" node in the Scene dock. At first it appears on the dock, but not on the viewport. This is because both Labels are on top of each-other. Click on your second Label in the Scene dock and click the move button at the top of the screen (or press w). Drag in any direction to see the new Label.

Open the  scene and and add another Label as a child of the root node (which should also be a label). Change the text property to "Label number 2". Save the scene. Go back to the  scene and notice how both the new and old labels overlap? Go back to the Label scene, select the second Label and move it down by clicking "Shift+Down arrow" 5 times. Save. Go to the other scene. Both Label scenes display correctly, not just one.

On the second label in your scene, left click and check. Click the gray Label button (the child of the second Label), and change it's text property to "Edited child". The other Label and the  scene were not changed, but one you changed was.

Right click on the Label with editable children and press. Now the modified label scene is no-longer linked, you can do some finer tweaking like renaming the child or deleting it. You can play around with your new scenes, or continue on.

What you have learned

 * 1) What nodes are in Godot and how to use each of the three basic ones.
 * 2) How to instance a scene into another, and how to save existing nodes into a new Scene.
 * 3) About node inheritance.
 * 4) How to start a new project.

Quiz

{Name one of the three main node types: } { Node|Node2D|Control|CanvasItem|Spatial|node|node2d|control|canvasitem|spatial }
 * type="{}"

{Do editable children allow you to edit the original scene? } -Yes +No
 * type=""

{Can you can instance a scene from another scene, then instance that scene from two different ones? } +Yes -No
 * type=""
 * That's what makes Godot's scene system flexible

{Which of these are the one that all the others inherit? } -Node +Object -SceneTree -CanvasItem
 * type=""


text:
Guide to the Godot game engine/Helpful links

Other Wikibooks

 * Video Game Design

Official websites

 * Godot's official website: https://godotengine.org

 * Godot's official unstable (latest) documentation: https://docs.godotengine.org/en/latest

 * Godot's official stable documentation: https://docs.godotengine.org/en/stable
 * Godot's official forum: https://forum.godotengine.org/

Third Party websites

 * Kids Can Code - Godot recipes: https://kidscancode.org/godot_recipes


text:
User:Mudenda Gideon

User:Mudenda Gideon

title: User:Mudenda Gideon