### Basic C++ Main Function Source: https://github.com/boostorg/boost/blob/master/doc/test/gold/index.html A simple C++ main function demonstrating a double variable declaration and return statement. This is a basic example for testing code block rendering. ```cpp int main() { double d = 2.345; return d; } ``` -------------------------------- ### Basic C++ Hello World Source: https://github.com/boostorg/boost/blob/master/doc/test/gold/document_to_test_formatting/code_blocks.html A standard C++ program for printing 'Hello, World!' to the console. Ensure the iostream library is included. ```cpp #include int main() { // Sample code std::cout << "Hello, World\n"; return 0; } ``` -------------------------------- ### Aggregate Initialization of boost::array Source: https://github.com/boostorg/boost/blob/master/doc/test/gold/document_to_test_formatting/array.html Use this syntax to initialize a boost::array with a brace-enclosed list of initializers for its elements. If fewer elements are provided than the array size, remaining elements are default-initialized. ```cpp boost::array a = { { 1, 2, 3 } }; ``` -------------------------------- ### Specialized Algorithms Source: https://github.com/boostorg/boost/blob/master/doc/test/gold/boost/array.html Details on the non-member swap function for Boost.Array. ```APIDOC ## `array` specialized algorithms 1. template void swap([array](array.html "Class template array")& x, [array](array.html "Class template array")& y); Effects: `x.[swap](array.html#id331235-bb)(y)` Throws: will not throw. ``` -------------------------------- ### Simplified Aggregate Initialization of boost::array Source: https://github.com/boostorg/boost/blob/master/doc/test/gold/document_to_test_formatting/array.html For standard-conforming compilers, you can use fewer braces for aggregate initialization of boost::array. This simplifies the initialization syntax. ```cpp boost::array a = { 1, 2, 3 }; ``` -------------------------------- ### Capacity Source: https://github.com/boostorg/boost/blob/master/doc/test/gold/boost/array.html Methods to query the size and emptiness of the array. ```APIDOC ## `array` capacity 1. size_type size(); Returns: `N` 2. bool empty(); Returns: `N==0` Throws: will not throw 3. size_type max_size(); Returns: `N` Throws: will not throw ``` -------------------------------- ### Constructors, Copy, and Destructor Source: https://github.com/boostorg/boost/blob/master/doc/test/gold/boost/array.html Details on the assignment operator for Boost.Array, allowing copying from another array of a potentially different type. ```APIDOC ## `array` public construct/copy/destruct 1. template array& operator=(const [array](array.html "Class template array")& other); Effects: `std::copy(rhs.[begin](array.html#id330718-bb)(),rhs.[end](array.html#id330751-bb)(), [begin](array.html#id330718-bb)())` ``` -------------------------------- ### Iterator Support Source: https://github.com/boostorg/boost/blob/master/doc/test/gold/boost/array.html Provides methods for obtaining iterators to the beginning and end of the array. ```APIDOC ## `array` iterator support 1. iterator begin(); const_iterator begin() const; Returns: iterator for the first element Throws: will not throw 2. iterator end(); const_iterator end() const; Returns: iterator for position after the last element Throws: will not throw ``` -------------------------------- ### C++ Function with Return Callout Source: https://github.com/boostorg/boost/blob/master/doc/test/gold/document_to_test_formatting/code_blocks.html A C++ function returning a string, featuring a callout on the return statement. This highlights inline callout placement. ```cpp std::string foo_bar() { return "foo-bar"; } ``` -------------------------------- ### weighted_tail_quantile_impl Source: https://github.com/boostorg/boost/blob/master/doc/test/gold/boost/accumulators/impl/weighted_tail_quantile__id330053.html Estimator of tail quantiles based on order statistics of weighted samples. ```APIDOC ## Struct template weighted_tail_quantile_impl ### Description An estimator of tail quantiles with a specified level based on order statistics of weighted samples. ### Synopsis ```cpp template struct weighted_tail_quantile_impl { // types typedef numeric::functional::average< Weight, std::size_t >::result_type float_type; typedef Sample result_type; // [construct/copy/destruct] weighted_tail_quantile_impl(dont_care); // [public member functions] template result_type result(Args const &) const; }; ``` ### Constructor #### `weighted_tail_quantile_impl(dont_care)` Default constructor. ### Member Functions #### `result(Args const & args) const` Returns the estimated tail quantile. ``` -------------------------------- ### Stream Inserter for sub_match Source: https://github.com/boostorg/boost/blob/master/doc/test/gold/document_to_test_formatting/code_blocks.html Documentation for the stream inserter operator used to output sub_match objects to a basic_ostream. ```APIDOC ## Stream Inserter for sub_match ### Description Overloaded stream insertion operator (`<<`) for outputting `sub_match` objects to a `basic_ostream`. ### Operator - `operator<<` ``` -------------------------------- ### Reverse Iterator Support Source: https://github.com/boostorg/boost/blob/master/doc/test/gold/boost/array.html Enables reverse iteration over the array elements. ```APIDOC ## `array` reverse iterator support 1. reverse_iterator rbegin(); const_reverse_iterator rbegin() const; Returns: reverse iterator for the first element of reverse iteration 2. reverse_iterator rend(); const_reverse_iterator rend() const; Returns: reverse iterator for position after the last element in reverse iteration ``` -------------------------------- ### Addition Operators for sub_match Source: https://github.com/boostorg/boost/blob/master/doc/test/gold/document_to_test_formatting/code_blocks.html Details the overloaded addition operators for concatenating sub_match objects with strings or other sub_match objects. ```APIDOC ## Addition Operators for sub_match ### Description Overloaded operators for concatenating `sub_match` objects with `std::basic_string` or C-style strings, and other `sub_match` objects. ### Operators - `operator+` (string + sub_match) - `operator+` (sub_match + string) - `operator+` (C-style string + sub_match) - `operator+` (sub_match + C-style string) - `operator+` (value_type + sub_match) - `operator+` (sub_match + value_type) - `operator+` (sub_match + sub_match) ``` -------------------------------- ### Less than or equal to operator (<=) Source: https://github.com/boostorg/boost/blob/master/doc/test/gold/boost/array.html Compares two Boost.Array objects for less than or equal to relationship. Returns true if the first array is element-wise less than or equal to the second array, and false otherwise. ```APIDOC ## operator<= ### Description Compares two Boost.Array objects for less than or equal to relationship. ### Method operator<= ### Template Parameters - typename T: The type of elements stored in the array. - std::size_t N: The size of the array. ### Parameters - const [array](array.html "Class template array") arr1 = {1, 2, 3}; boost::array arr2 = {1, 2, 4}; bool result = (arr1 <= arr2); // result will be true ``` ``` -------------------------------- ### Element Access Source: https://github.com/boostorg/boost/blob/master/doc/test/gold/boost/array.html Provides methods for accessing individual elements of the array using index, including bounds-checked access. ```APIDOC ## `array` element access 1. reference operator[](size_type i); const_reference operator[](size_type i) const; Requires: `i < N` Returns: element with index `i` Throws: will not throw. 2. reference at(size_type i); const_reference at(size_type i) const; Returns: element with index `i` Throws: `std::range_error` if `i >= N` 3. reference front(); const_reference front() const; Requires: `N > 0` Returns: the first element Throws: will not throw 4. reference back(); const_reference back() const; Requires: `N > 0` Returns: the last element Throws: will not throw 5. const T* data() const; Returns: `elems` Throws: will not throw 6. T* c_array(); Returns: `elems` Throws: will not throw ``` -------------------------------- ### weighted_tail_quantile Extractor Source: https://github.com/boostorg/boost/blob/master/doc/test/gold/boost/accumulators/extract/weighted_tail_quantile.html The weighted_tail_quantile is a global extractor provided by the Boost Accumulators library. It is used in conjunction with the tag::quantile to extract weighted tail quantiles from accumulator results. ```APIDOC ## Global weighted_tail_quantile ### Description Provides access to the weighted tail quantile calculation within the Boost Accumulators framework. This extractor is used to retrieve quantile values from weighted data. ### Synopsis ```cpp // In header: boost::accumulators::extract::extractor< tag::quantile > const weighted_tail_quantile; ``` ### Usage This extractor is typically used with the `tag::quantile` to compute quantiles on weighted datasets. For example: ```cpp // Assuming 'acc' is a weighted_tail_quantile accumulator auto quantile_value = extract_result(acc); ``` ### Header `` ``` -------------------------------- ### Class template array Source: https://github.com/boostorg/boost/blob/master/doc/test/gold/boost/array.html The boost::array class template is an STL-compliant container wrapper for arrays of constant size. ```APIDOC ## Class template array ### Description Boost.Array is an STL-compliant container wrapper for arrays of constant size. ### Synopsis ```cpp template class array { public: // types typedef T value_type; typedef T* iterator; typedef const T* const_iterator; typedef std::reverse_iterator reverse_iterator; typedef std::reverse_iterator const_reverse_iterator; typedef T& reference; typedef const T& const_reference; typedef std::size_t size_type; typedef std::ptrdiff_t difference_type; // static constants static const size_type static_size = N; // construct/copy/destruct template array& operator=(const array&); // iterator support iterator begin(); const_iterator begin() const; iterator end(); const_iterator end() const; // reverse iterator support reverse_iterator rbegin(); const_reverse_iterator rbegin() const; reverse_iterator rend(); const_reverse_iterator rend() const; // capacity size_type size(); bool empty(); size_type max_size(); // element access reference operator[](size_type); const_reference operator[](size_type) const; reference at(size_type); const_reference at(size_type) const; reference front(); const_reference front() const; reference back(); const_reference back() const; const T* data() const; T* c_array(); // modifiers void swap(array&); void assign(const T&); T elems[N]; }; ``` ### Specialized Algorithms ```cpp template void swap(array&, array&); ``` ### Comparisons ```cpp template bool operator==(const array&, const array&); template bool operator!=(const array&, const array&); template bool operator<(const array&, const array&); template bool operator>(const array&, const array&); ``` ``` -------------------------------- ### Less Than or Equal To Operator (<=) Source: https://github.com/boostorg/boost/blob/master/doc/test/gold/boost/array.html Compares two Boost.Array objects. Returns true if the first array is lexicographically less than or equal to the second. ```APIDOC ## operator<= ### Description Compares two Boost.Array objects. Returns true if the first array is lexicographically less than or equal to the second. ### Signature ```cpp template bool operator<=(const array& x, const array& y); ``` ### Returns `!(y < x)` ``` -------------------------------- ### weighted_tail_quantile Struct Template Source: https://github.com/boostorg/boost/blob/master/doc/test/gold/boost/accumulators/tag/weighted_tail_quantile.html The weighted_tail_quantile struct template is used to specify the weighted tail quantile calculation within Boost Accumulators. It inherits from sum_of_weights and tail_weights. ```APIDOC ## Struct template weighted_tail_quantile ### Description `boost::accumulators::tag::weighted_tail_quantile` is a struct template used as a tag in the Boost Accumulators library to indicate the calculation of weighted tail quantiles. It depends on `sum_of_weights` and `tail_weights`. ### Synopsis ```cpp template struct weighted_tail_quantile : public boost::accumulators::depends_on< sum_of_weights, tail_weights< LeftRight > > { }; ``` ### Header `` ``` -------------------------------- ### Inequality Operator (!=) Source: https://github.com/boostorg/boost/blob/master/doc/test/gold/boost/array.html Compares two Boost.Array objects for inequality. Returns true if any element differs, false otherwise. ```APIDOC ## operator!= ### Description Compares two Boost.Array objects for inequality. Returns true if any element differs, false otherwise. ### Signature ```cpp template bool operator!=(const array& x, const array& y); ``` ### Returns `!(x == y)` ``` -------------------------------- ### Comparison Operators for sub_match Source: https://github.com/boostorg/boost/blob/master/doc/test/gold/document_to_test_formatting/code_blocks.html Provides overloaded comparison operators for comparing sub_match objects with their value types. ```APIDOC ## Comparison Operators for sub_match ### Description Overloaded operators for comparing `sub_match` objects with their corresponding value types. ### Operators - `operator>` - `operator>=` - `operator<=` - `operator==` - `operator!=` - `operator<` ``` -------------------------------- ### C++ Class with Callouts Source: https://github.com/boostorg/boost/blob/master/doc/test/gold/document_to_test_formatting/code_blocks.html A C++ class definition demonstrating the use of embedded callouts, typically used for annotations or explanations within code. ```cpp class x { public: x() : n(0) { } ~x() { } int get() const { return n; } void set(int n_) { n = n_; } }; ``` -------------------------------- ### Equality Operator (==) Source: https://github.com/boostorg/boost/blob/master/doc/test/gold/boost/array.html Compares two Boost.Array objects for equality. Returns true if all elements are equal, false otherwise. ```APIDOC ## operator== ### Description Compares two Boost.Array objects for equality. Returns true if all elements are equal, false otherwise. ### Signature ```cpp template bool operator==(const array& x, const array& y); ``` ### Returns `std::equal(x.begin(), x.end(), y.begin())` ``` -------------------------------- ### Sub_match Comparisons with std::basic_string Source: https://github.com/boostorg/boost/blob/master/doc/test/gold/document_to_test_formatting/code_blocks.html These operators allow for comparisons between a sub_match object and a std::basic_string. Ensure the iterators and string types are compatible. ```C++ template bool operator != (const sub_match& lhs, const std::basic_string::value_type, traits, Allocator>& rhs); template bool operator < (const sub_match& lhs, const std::basic_string::value_type, traits, Allocator>& rhs); template bool operator > (const sub_match& lhs, const std::basic_string::value_type, traits, Allocator>& rhs); template bool operator >= (const sub_match& lhs, const std::basic_string::value_type, traits, Allocator>& rhs); template bool operator <= (const sub_match& lhs, const std::basic_string::value_type, traits, Allocator>& rhs); ``` -------------------------------- ### Less Than Operator (<) Source: https://github.com/boostorg/boost/blob/master/doc/test/gold/boost/array.html Performs a lexicographical comparison between two Boost.Array objects. Returns true if the first array is lexicographically less than the second. ```APIDOC ## operator< ### Description Performs a lexicographical comparison between two Boost.Array objects. Returns true if the first array is lexicographically less than the second. ### Signature ```cpp template bool operator<(const array& x, const array& y); ``` ### Returns `std::lexicographical_compare(x.begin(), x.end(), y.begin(), y.end())` ``` -------------------------------- ### Greater than or equal to operator (>=) Source: https://github.com/boostorg/boost/blob/master/doc/test/gold/boost/array.html Compares two Boost.Array objects for greater than or equal to relationship. Returns true if the first array is element-wise greater than or equal to the second array, and false otherwise. ```APIDOC ## operator>= ### Description Compares two Boost.Array objects for greater than or equal to relationship. ### Method operator>= ### Template Parameters - typename T: The type of elements stored in the array. - std::size_t N: The size of the array. ### Parameters - const [array](array.html "Class template array") arr1 = {1, 2, 3}; boost::array arr2 = {1, 2, 2}; bool result = (arr1 >= arr2); // result will be true ``` ``` -------------------------------- ### Stream Inserter for sub_match Source: https://github.com/boostorg/boost/blob/master/doc/test/gold/document_to_test_formatting/code_blocks.html This operator allows for direct insertion of a sub_match object into an output stream. It simplifies the process of printing regex match results. ```cpp template basic_ostream& operator << (basic_ostream& os, const sub_match& m); ``` -------------------------------- ### Greater Than or Equal To Operator (>=) Source: https://github.com/boostorg/boost/blob/master/doc/test/gold/boost/array.html Compares two Boost.Array objects. Returns true if the first array is lexicographically greater than or equal to the second. ```APIDOC ## operator>= ### Description Compares two Boost.Array objects. Returns true if the first array is lexicographically greater than or equal to the second. ### Signature ```cpp template bool operator>=(const array& x, const array& y); ``` ### Returns `!(x < y)` ``` -------------------------------- ### Addition Operators for sub_match Source: https://github.com/boostorg/boost/blob/master/doc/test/gold/document_to_test_formatting/code_blocks.html These operators enable concatenation between sub_match objects and strings or string literals. They are used to construct new strings from regex match results. ```cpp template std::basic_string::value_type, traits, Allocator> operator + (const std::basic_string::value_type, traits, Allocator>& s, const sub_match& m); template std::basic_string::value_type, traits, Allocator> operator + (const sub_match& m, const std::basic_string::value_type, traits, Allocator>& s); ``` ```cpp template std::basic_string::value_type> operator + (typename iterator_traits::value_type const* s, const sub_match& m); template std::basic_string::value_type> operator + (const sub_match& m, typename iterator_traits::value_type const * s); ``` ```cpp template std::basic_string::value_type> operator + (typename iterator_traits::value_type const& s, const sub_match& m); template std::basic_string::value_type> operator + (const sub_match& m, typename iterator_traits::value_type const& s); ``` ```cpp template std::basic_string::value_type> operator + (const sub_match& m1, const sub_match& m2); ``` -------------------------------- ### Sub_match Comparisons with Single Character Source: https://github.com/boostorg/boost/blob/master/doc/test/gold/document_to_test_formatting/code_blocks.html These operators enable comparisons between a sub_match object and a single character. The character type must be compatible with the sub_match's iterator value type. ```C++ template bool operator == (typename iterator_traits::value_type const& lhs, const sub_match& rhs); template bool operator != (typename iterator_traits::value_type const& lhs, const sub_match& rhs); template bool operator < (typename iterator_traits::value_type const& lhs, const sub_match& rhs); ``` -------------------------------- ### C++ Function with Long Line Source: https://github.com/boostorg/boost/blob/master/doc/test/gold/document_to_test_formatting/code_blocks.html A C++ template function that contains a very long line of code. This demonstrates handling of extended line lengths. ```cpp template RealType inline foo(const RealType& a, const RealType& b, const RealType& c, const RealType& d, const RealType& e, const RealType& f, const RealType& g, const RealType& h){ return 0; } ``` -------------------------------- ### Greater Than Operator (>) Source: https://github.com/boostorg/boost/blob/master/doc/test/gold/boost/array.html Performs a lexicographical comparison between two Boost.Array objects. Returns true if the first array is lexicographically greater than the second. ```APIDOC ## operator> ### Description Performs a lexicographical comparison between two Boost.Array objects. Returns true if the first array is lexicographically greater than the second. ### Signature ```cpp template bool operator>(const array& x, const array& y); ``` ### Returns `y < x` ``` -------------------------------- ### Sub_match Comparisons with Pointer to Character Array Source: https://github.com/boostorg/boost/blob/master/doc/test/gold/document_to_test_formatting/code_blocks.html These operators facilitate comparisons between a sub_match object and a C-style string (pointer to character array). The character type must match the iterator's value type. ```C++ template bool operator == (typename iterator_traits::value_type const* lhs, const sub_match& rhs); template bool operator != (typename iterator_traits::value_type const* lhs, const sub_match& rhs); template bool operator < (typename iterator_traits::value_type const* lhs, const sub_match& rhs); template bool operator > (typename iterator_traits::value_type const* lhs, const sub_match& rhs); template bool operator >= (typename iterator_traits::value_type const* lhs, const sub_match& rhs); template bool operator <= (typename iterator_traits::value_type const* lhs, const sub_match& rhs); template bool operator == (const sub_match& lhs, typename iterator_traits::value_type const* rhs); template bool operator != (const sub_match& lhs, typename iterator_traits::value_type const* rhs); template bool operator < (const sub_match& lhs, typename iterator_traits::value_type const* rhs); template bool operator > (const sub_match& lhs, typename iterator_traits::value_type const* rhs); template bool operator >= (const sub_match& lhs, typename iterator_traits::value_type const* rhs); template bool operator <= (const sub_match& lhs, typename iterator_traits::value_type const* rhs); ``` -------------------------------- ### Modifiers Source: https://github.com/boostorg/boost/blob/master/doc/test/gold/boost/array.html Functions to modify the array's contents, such as swapping elements or filling with a specific value. ```APIDOC ## `array` modifiers 1. void swap([array](array.html "Class template array")& other); Effects: `std::swap_ranges([begin](array.html#id330718-bb)(), [end](array.html#id330751-bb)(), other.[begin](array.html#id330718-bb)())` Complexity: linear in `N` 2. void assign(const T& value); Effects: `std::fill_n([begin](array.html#id330718-bb)(), N, value)` ``` -------------------------------- ### Comparison Operators for sub_match Source: https://github.com/boostorg/boost/blob/master/doc/test/gold/document_to_test_formatting/code_blocks.html These operators allow for comparison between a sub_match object and a value of the iterator's value type. They are useful for direct comparisons in regex matching results. ```cpp template bool operator > (typename iterator_traits::value_type const& lhs, const sub_match& rhs); template bool operator >= (typename iterator_traits::value_type const& lhs, const sub_match& rhs); template bool operator <= (typename iterator_traits::value_type const& lhs, const sub_match& rhs); ``` ```cpp template bool operator == (const sub_match& lhs, typename iterator_traits::value_type const& rhs); template bool operator != (const sub_match& lhs, typename iterator_traits::value_type const& rhs); template bool operator < (const sub_match& lhs, typename iterator_traits::value_type const& rhs); template bool operator > (const sub_match& lhs, typename iterator_traits::value_type const& rhs); template bool operator >= (const sub_match& lhs, typename iterator_traits::value_type const& rhs); template bool operator <= (const sub_match& lhs, typename iterator_traits::value_type const& rhs); ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.