C++ Standard Templates (STL) – Type Support (type attributes, is_abstract, is_signed, is_unsigned)

Type attributes A type attribute defines a compile-time template-based structure for querying or modifying the properties of a type. Attempting to specialize a template defined in the header results in undefined behavior, except that std::common_type can be specialized as described. Templates defined in the header file may be instantiated with incomplete types unless otherwise specified, […]

C++ Standard Templates (STL) – Type Support (type attributes, is_literal_type, is_polymorphic, is_empty)

Type attributes A type attribute defines a compile-time template-based structure for querying or modifying the properties of a type. Attempting to specialize a template defined in the header results in undefined behavior, except that std::common_type can be specialized as described. Templates defined in the header file may be instantiated with incomplete types unless otherwise specified, […]

C++ custom STL container memory allocator (map, set, vector, string, unordered_map, unordered_set)

Notice: When using the C++ 11/14 standard, you should comment the following code and restore the above commented code, that is, set the compiler option standard to: -std=cxx1z, -std=cxx2a. // C++17…cxx1z //template <class _Iter> //constexpr void* _Voidify_iter(_Iter _It) noexcept { // if constexpr (std::is_pointer<_Iter>::value) { // return const_cast<void*>(static_cast<const volatile void*>(_It)); // } // else { […]

C++ Standard Templates (STL) – Type Support (type attributes, is_pod, is_trivially_copyable, is_standard_layout)

Type attributes A type attribute defines a compile-time template-based structure for querying or modifying the properties of a type. Attempting to specialize a template defined in the header results in undefined behavior, except that std::common_type can be specialized as described. Templates defined in the header file may be instantiated with incomplete types unless otherwise specified, […]

7. Handwritten Vector (imitating STL-vector) (only encapsulation idea)

Handwritten Vector (imitating STL-vector) (only encapsulation idea) /********************************************** *************************** > File Name: vector.cpp > Author:Xiao Yuheng > Mail:[email protected] > Created Time: Wed Nov 1 07:04:57 2023 *************************************************** ************************/ ? #include <iostream> #include <cstring> ? using namespace std; ? int *allocate(int n) { return new int[n]; } void destroy(int *data) { delete[] data; } ? class […]

C++ Standard Templates (STL) – Type Support (type attributes, is_volatile, is_trivial, is_const)

Type attributes A type attribute defines a compile-time template-based structure for querying or modifying the properties of a type. Attempting to specialize a template defined in the header results in undefined behavior, except that std::common_type can be specialized as described. Templates defined in the header file may be instantiated with incomplete types unless otherwise specified, […]

C++ Standard Templates (STL) – Type Support (composite type categories, is_member_pointer, is_reference, is_compound)

Type attributes A type attribute defines a compile-time template-based structure for querying or modifying the properties of a type. Attempting to specialize a template defined in the header results in undefined behavior, except that std::common_type can be specialized as described. Templates defined in the header file may be instantiated with incomplete types unless otherwise specified, […]

STL follow-list container

Compared with the stack container, the list container is completely different. The list container can be understood as a doubly linked list or a double-ended dynamic array. List container features: Elements can be inserted and deleted at any position, with time complexity O(1), Random access to elements is not supported. Accessing elements requires traversing the […]

ubuntu PX4 vscode stlink debug settings

Hardware stlink holybro debug board pixhawk4 Install openocd Official documentation, but the first step of installation is recommended to install from the source code, which has fewer bugs. github link Compile and install, refer to ./bootstrap (when building from the git repository) ./configure [options] make sudo make install After installation, there is an openocd under […]