Solve the undefined identifier “string”, undefined identifier “cout”, “name” encountered in C++: unknown rewrite specifier error

Table of Contents Solve undefined identifier “string”, undefined identifier “cout”, “name” encountered by C++: unknown rewrite specifier error 1. Undefined identifier “string” 2. Undefined identifier “cout” 3. “name”: unknown rewrite specifier error Summarize 1. Undefined identifier “string” 2. Undefined identifier “cout” 3. “name”: unknown rewrite specifier error Resolve undefined identifier “string”, undefined identifier “cout”, “name” […]

09 | Usability Improvements II: Literals, Static Assertions, and Member Function Specifiers

In this lesson we continue the topic of usability and look at other usability improvements brought by modern C++. Custom literals Literals refer to fixed constants written in source code. They can only be primitive types in C++98, such as: “hello”, string literal, type is const char[6] 1. Integer literal, type is int 0.0, floating […]

c++ conversion specifiers reproduced

I keep forgetting, I just saw it today and reposted it, so that it can help other students to understand and review it by myself! 1. conversion specifier %a(%A) Floating point numbers, hexadecimal numbers and p-(P-) notation (C99) %c character %d signed decimal integer %f floating point number (including float and double) %e(%E) Floating-point exponent […]

format string f-string format specifier format specifier

format string f-string format specifier format specifier Overview Python supports multiple formatting string methods, including %-formatting, str.format(), string.Template. PEP 498 proposes a new string formatting mechanism: Literal String Interpolation. Strings using this mechanism are “f-strings”. %-formatting supports limited data types, and errors may occur during use. 【error prone】 Some formatting of %-formatting and string.Template cannot […]

[C/C++ keyword function specifier] C/C++ _Noreturn keyword (indicates that the function does not return to the calling function after the call is completed)

Directory Title 1. Introduction: Introduction to the _Noreturn keyword 1.1 Definition of _Noreturn keyword 1.2 The difference between _Noreturn and void 2. Design intent of the _Noreturn keyword 2.1 Why do we need the _Noreturn keyword 2.2 _Noreturn keyword optimization 3. Usage scenario of _Noreturn keyword 3.1 When to use the _Noreturn keyword 3.2 Restrictions […]

[C/C++ keyword function specifier] C++ noexcept keyword (specify that a function does not throw an exception)

Directory Title C++ exception handling plan for design how to use Two ways of throwing exceptions When should I use noexcept? Precautions for correct use of noexcept In-depth understanding of noexcept and its performance optimization Conclusion For more exciting content, please read my column: C/C++ Keyword Column Exception handling in C++ The noexcept specifier can […]

[C/C++ keyword function specifier] C++ final keyword (decorated member functions cannot be overridden by subclasses)

Directory Title 1. Introduction to C ++ `final` keyword 1.1 The definition and design intent of `final` keyword 2. Usage of `final` keyword 2.1 How to use the `final` keyword in classes and member functions Usage of `final` in class Usage of `final` in member functions 2.2 The relationship between the `final` keyword and virtual […]

[C/C++ keyword storage class specifier] The mutable keyword of C/C++ ignores the constant check of the data member and modifies the variable value in the const function

Write the directory title here 1. Introduction 1.1 Introduction to mutable keywords 2. The Design Intent of the mutable Keyword (The Design Intent of the mutable Keyword) 2.1 Why Do We Need the mutable Keyword (Why Do We Need the mutable Keyword) 2.2 How the mutable Keyword Solves Constancy Issues 3. Usage Scenarios of the […]

[Solved] opencv(14):error: expected type-specifier operator cv::_InputOutputArray()

Error: error: expected type-specifier operator cv::_InputOutputArray() {<!– –> Error code: #include <Eigen/Core> #include <opencv2/opencv.hpp> // 167 lines operator cv::_InputOutputArray() { return cv::_InputOutputArray(this->mBody); } Reason: The current opencv version may not contain the cv::_InputOutputArray() function, or the function form may be different (1) native opencv version pkg-config –modversion opencv That is, the version is opencv2.4.13 (2) […]

[Solved] SyntaxError: Invalid regular expression: invalid group specifier name

Regular problem Safari SyntaxError: Invalid regular expression: invalid group specifier name Firefox SyntaxError: invalid regexp group Mobile terminal: Android is normal, iOS is not Reason Firefox, IE, IOS do not support the following writing methods Commonly used zero-width assertions: ?Look-ahead is a conditional judgment, like an if statement (?=exp) positive look-ahead matches the position that […]