diff --git a/user-guide/modules/ROOT/pages/faq.adoc b/user-guide/modules/ROOT/pages/faq.adoc index e6591c5..7f5b651 100644 --- a/user-guide/modules/ROOT/pages/faq.adoc +++ b/user-guide/modules/ROOT/pages/faq.adoc @@ -1840,7 +1840,7 @@ The boost:utility/doc/html/utility/utilities[Boost.StringView] library has now b . *Can you show me example code where standard integers and Boost.Multiprecision code work well together?* + The following code shows automatic promotion (`big_int += small_int`), arbitrary precision (`cpp_int` grows as large as is needed), high-precision floating point (`area = high_precision_pi * radius * radius`), and interoperability (`approx_area` conversion): - ++ [source,cpp] ---- #include @@ -1888,9 +1888,9 @@ int main() { } ---- - ++ Running this code should give you: - ++ [source,text] ---- Big integer (with 42 added): 100000000000000000000000000000000000000000000000042 @@ -1901,9 +1901,14 @@ Area (as double): 19.63495408493621 Sum of first 1,000,000 integers: 500000500000 ---- - ++ boost:multiprecision[] is designed to seamlessly extend the built-in numeric types, so you can mix `std::int`, `std::uint64_t`, `double`, and multiprecision types freely — the library's operator overloads handle promotion automatically. Typically, in scientific computing (very large floating point numbers) `cpp_dec_float_50` is combined with `double`, and for working with very large integers (say boundary values), combine `cpp_int` with `std::int64_t` or `std::size_t`. +. *I am having trouble with a multi-platfrom project that requires strings in UTF-8 format, but with Windows APIs requiring UTF-16?* ++ +You should conside using boost:nowide[], a library that makes Windows Unicode handling sane! This library provides UTF-8 versions of `fopen`, `std::cout`, as well as file I/O and environmental variables. It also provides the crucial automatic conversion to UTF-16 when calling Windows APIs. You might also find boost:locale[] useful if internationalization is required, boost:static-string[], and the `small_vector` type of boost:container[] for efficient short-string handling. + + == See Also * xref:contributor-guide:ROOT:contributors-faq.adoc[Contributor Guide FAQ] diff --git a/user-guide/modules/ROOT/pages/glossary.adoc b/user-guide/modules/ROOT/pages/glossary.adoc index 972c0bc..e2286cd 100644 --- a/user-guide/modules/ROOT/pages/glossary.adoc +++ b/user-guide/modules/ROOT/pages/glossary.adoc @@ -52,6 +52,9 @@ Where terms apply specifically to one technology, such as _Quantum Computing_ or *Bikeshedding* or *BS* : _Focusing on trivial issues_ +[[binding]] +*Binding* : The process of associating identifiers (like variables or functions) with values, types, or memory locations — can be static or dynamic. _Static binding_ occurs at compile time (the compiler knows exactly which function to call). _Dynamic binding_ happens at runtime — the decision about which function to call is deferred until the program runs (often using <> ). + [[bloom-filter]] *Bloom Filter* : A space-efficient, fast, and probabilistic structure that can tell you if an item is _definitely not in a database_ or is _possibly in the database_. For example, say you have a database of bad actors that is used to help prevent fraudulent access to a financial web app. A bloom filter can be used to tell if a new transaction _definitely_ does not come from this set, so proceed normally, or _possibly comes from this set_ in which case a deeper investigation into its validity (a full search of the bad actors) should be carried out. The following diagram shows the flow of control: @@ -190,6 +193,8 @@ Note:: The Bloom filter is named after its inventor, Burton Howard Bloom, who de *GIL* : Generic Image Library - boost:gil[] is a library designed for image processing, offering a flexible way to manipulate and process images. +*Grapheme Cluster* : The smallest unit of text that a user _perceives_ as a single character, even though it may actually consist of multiple Unicode code points. This is important to represent languages like Hindi, Thai, Korean, Japanese, and others. + *gRPC* : A high-performance, open-source RPC (Remote Procedure Call) framework developed by Google that uses Protocol Buffers (protobuf) for defining service interfaces and message types. It enables efficient, strongly-typed communication between distributed systems over HTTP/2, supporting features like streaming, authentication, and load balancing. It is a competitor to a point of REST and OpenAPI. [[h]] @@ -350,6 +355,8 @@ Note:: For uses of hash functions in Boost libraries, refer to boost:hash2[], an Mustache is a similar but simpler alternative to <>. +*Mutation* : Modifying the state of an object or variable in place (for example, altering a list rather than creating a new one). The opposite of mutation is _immutable_ - once created, the object's value cannot be changed — any modification produces a new object instead. + *MVP* : Model-View-Presenter == N @@ -360,6 +367,21 @@ Mustache is a similar but simpler alternative to <>. *NLL* : Non-Lexical Lifetimes - an NLL <> in the https://www.rust-lang.org/[Rust] language that uses a more precise, dataflow-based analysis to determine when a borrow starts and ends, based on the actual usage of the variables. This allows for more flexible and intuitive borrowing rules. +[[normalize]] +*Normalize* : + +* When working with strings, transforming strings into a canonical form so comparisons work as expected. Used heavily in Unicode and filesystem paths, for example: "é" can be stored as one code point or two; normalization makes them match. There are several normalization strategies: ++ +** *NFC* : Normalized Form C (Canonical Composition) - characters are converted to canonical equivalents and then composed into pre-combined forms when possible. For example: e + ◌́ → é +(U+0065 U+0301 → U+00E9). +** *NFD* : Normalized Form D (Canonical Decomposition) - characters are decomposed into base characters and combining marks. For example: é → e + ◌́ (U+00E9 → U+0065 U+0301) +** *NFKC* : Normalization Form KC (Compatibility Composition) - converts characters to their compatibility equivalents, then composes them. For example, “①” → “1”. +** *NFKD* : Normalization Form KD (Compatibility Decomposition) - converts compatibility characters to their equivalents and decomposes them. For example: “㍿” (Japanese corporate sign) → “株式会社”. + +Use NFC for most applications. Consider NFKC or NFKD for search engines, security checks, deduplication. Consider NFD for low-level linguistic processing. + +* In mathematics, adjusting values in a dataset to a common scale. Vectors are often normalized so that they represent a single unit in any direction. + *NTTP* : Non-Type Template Parameter == O @@ -396,16 +418,32 @@ An open-method library is currently in the Boost formal review process. * _Perception Is My Lasting Principle_ - the "Cheshire Cat" idiom where someone's perception of reality is subjective +*Pinyin Order* : A common system of sorting written Chinese based on the romanized pronunciation of the characters. Sorts characters like English words A through Z based on the Pinyin spelling and tone. This compares with _Stroke Order_ - which sorts based on the number of strokes in the written character - and _Radical Order_ - a sorting system based on the traditional Kangxi radicals. Pinyin ordering is common in dictionaries aimed at learners, phone books, and computer input systems. + *PITA* : _Pain In The Application_ or _Programmer In Trouble Again_ - difficult or frustrating code issue, such as when debugging AI-hallucinated functions. *POD* : _Plain Old Data_ +*Polymorphism* : In object-orientated programming, refers to having one common interface to an arbitrary set of specific types. + *POSIX* : Portable Operating System Interface *PPA* : Personal Package Archive - a repository on Launchpad (a platform for Ubuntu software collaboration) that allows developers and maintainers to distribute software or updates that are not yet included in the official Ubuntu repositories. *PR* : Pull Request - a request to include specified content into a GitHub repository. An administrator can accept or reject the PR. +*Promotion* : A compiler _promotes_ a smaller type to a larger type so an operation can be done safely. For example: + +[source,cpp] +---- +int a = 42; +long long b = a; // promotion: int -> long long + +---- + +The reverse ( `a = b;` ) is not a promotion, it would be an unsafe conversion. The key point is there is no danger of data loss in a promotion. + + [[q]] == Q @@ -523,15 +561,19 @@ _This diagram shows the basic process of quantum teleportation, where the unknow * *Send and sync* : these are _type traits_ that ensure memory-safety between threads. The _send_ is enabled for a variable if it is safe to transfer ownership of its value to another thread. A _sync_ trait is enabled if it is safe to share a reference to a value with other threads. * *The `safe` context* : operations in the `safe` context are guaranteed not to cause undefined behavior. +*SFINAE* or *SFINAED* : _Substitution Failure Is Not An Error_ + *SHA* : Secure Hash Algorithm, a function that will reliably give different hash values for different inputs. -*SFINAE* or *SFINAED* : _Substitution Failure Is Not An Error_ +*Shadowing* : When a local variable or parameter hides another variable with the same name, where that second variable lives in an outer scope. *SIGILS* : refers to symbols or characters that precede a variable, literal, or keyword to indicate its type or purpose. For example, in "%hash" the "%" is a sigil. It is occasionally used with a tongue-in-cheek tone because of its mystical connotations, referring to how these symbols can seem "magical" in making the code work! *SipHash* : A cryptographic hash for short messages (designed in 2012 by Jean-Philippe Aumasson and Daniel J. Bernstein). Specifically a pseudorandom function (PRF) keyed with a secret key to SipHash(k, message) to 64-bit hash. It is fast enough for hash table lookups, but unlike MurmurHash/FarmHash, it resists _hash-flooding attacks_. +*Slice* : Extracting a contiguous subsequence of a string, for example "ring" is a slice of "string". + *SMOP* : _Small Matter of Programming_ - sarcastically downplaying complex problems *SOLID* : Single Responsibility, Open/Closed, Liskov Substitution, Interface Segregation, Dependency Inversion (Design principles) @@ -539,6 +581,8 @@ It is fast enough for hash table lookups, but unlike MurmurHash/FarmHash, it res [[ssa]] *SSA* : Static Single Assignment - a property of intermediate representations (IRs) used in compilers. SSA is a popular technique in modern compilers to make optimizations and analysis simpler and more efficient. Each variable is assigned exactly once and is immutable after assignment. If a variable is updated, a new variable is created instead. Refer also to <>. +*Stitching* : Joining strings end-to-end. + *STL* : Standard Template Library *Swifties* : In the programming context, aficionados of the https://developer.apple.com/swift/[Swift] language. @@ -559,8 +603,12 @@ It is fast enough for hash table lookups, but unlike MurmurHash/FarmHash, it res *TL;DW* : _Too Long; Didn't Watch_ - used when someone posts an overly long video or demo +*Tokenize* : Breaking a string into meaningful syntactic units (words, symbols, numbers), often used by a compiler working with source code. + *Top Posting* : The process of replying to an email, or other message, by adding your comments entirely to the top of the discussion, as opposed to inline posting where responses are written to the individual points made in the thread. +*Trim* : Removing whitespace, or other specified characters, at the beginning or end of a string. + *TTI* : Type Traits Introspection - refer to boost:tti[] *TTOU* : _Time To Opt Out_ - used humorously to express wanting to quit a project that is heading south @@ -597,9 +645,12 @@ It is fast enough for hash table lookups, but unlike MurmurHash/FarmHash, it res *VoIP* : Voice over Internet Protocol - in networking libraries or real-time communication systems, VoIP is often discussed when implementing features for voice transmission over IP networks. +*Vptr* : A hidden pointer within an object, pointing to the class's <>. + *VR* : Virtual Reality - in game programming, simulations, or graphics-intensive applications, VR is often mentioned in discussions. pass:[C++] is commonly used for developing VR engines and related tools. -*VTable* : Virtual Table - a mechanism used in pass:[C++] to support dynamic (runtime) polymorphism through virtual functions. Discussions involving inheritance and object-oriented programming often reference vtables. +[[vtable]] +*VTable* : Virtual Table - a mechanism used in pass:[C++] to support dynamic (runtime) polymorphism through virtual functions. Discussions involving inheritance and object-oriented programming often reference vtables. Virtual tables are used in <>. Typically, if a class contains at least one virtual function, a compiler secretly creates a vtable for that class. The vtable stores addresses (pointers) to the actual implementations of that class's virtual functions. When you call a virtual function (for example, `ptr->speak()`), the program uses the `vptr → vtable → function pointer` chain to find and invoke the correct version. == W diff --git a/user-guide/modules/ROOT/pages/resources.adoc b/user-guide/modules/ROOT/pages/resources.adoc index cda9075..18bbba7 100644 --- a/user-guide/modules/ROOT/pages/resources.adoc +++ b/user-guide/modules/ROOT/pages/resources.adoc @@ -40,6 +40,12 @@ For more specific technical questions, Stack Overflow has many questions and ans * https://stackoverflow.com/questions/tagged/boost[Stack Overflow: Boost] +== Reddit + +Questions and answers of varying technical depth: + +* https://www.reddit.com/search/?q=boost+c%2B%2B+libraries&cId=98ecb41a-b24e-4aa2-bb8f-3376e144c0ee&iId=74828ff1-ce16-4410-beea-33ed14352bea[Reddit: Boost] + == See Also * https://pdimov.github.io/boostdep-report/[Boost Dependency Report]