[C + + STL (VS2012 Update4) source code reading Series (2)] familiar with some macro definitions and templates or template specialization
Point_test.cpp: Knowledge point exercises and tests, for single step debugging, tracking.//
#include "stdafx.h"#include #include #include
using namespace Std;For _1, _2, _3 ...Using namespace std::p laceholders;
Template{return std::move (t1 + T2);}
/*Test examples illustrate the various combinations of std::bind a
1. As a macro function, you don't need to enclose character values in quotation marks as Step functions.One-on-which macro language is different from SAS language is macro-variable valuesbe always text, quotatio n marks is not needed to indicate TEXR constants in the macro language. EXAMPLEDsid=open ("sasuser.houses"
SolidWorks two times development -01-record a macro
First step:
We need to record a macro ourselves and then see what code the program produces. That's what I did when I was learning Excel. Just, SolidWorks to be more complex, directly recorded macros can not be used, need to make some adjustments. In the absence of experience we'd better follow the advice below.
Edit or Debug SolidWorks
One of the advantages of preprocessing commands and macro definitions in VC
Author: Liu Wei Source: blog responsibility Editor: Ark
People who are new to MFC programming are often intimidated by various macro definitions and preprocessing commands generated by the MFC wizard. However, preprocessing and macro definition are a powerful tool in C languag
People who are new to MFC programming are often intimidated by various macro definitions and preprocessing commands generated by the MFC wizard. However, preprocessing and macro definition are a powerful tool in C language. They can be used for simple source code control, version control, warning, or some special functions.A classic exampleThe most classic example of using preprocessing and
[Special statement] This article is purely my personal behavior. It is totally out of my preferences and has nothing to do with Turing.
However, it should be noted that writing this book review is entirely from the whim. Although I want to maintain neutral, I am a publisher, and the service provider can be said to be a competitor of the publishing house. Therefore, it is not a suitable reviewer, please pay special attention to this when reading the f
#include #define F (A, b) a# #b #define g (a) #a #define H (a) g (a) int Main () {printf ( " %s\n , H (f (1 , 2 %s\n , G (F (1 , 2 return 0 ;}How to expand the rules for a macro function: when the current macro function is expanded, if the parameter has # or # #则不进行宏参数的展开, expand the macro argument first, and then expand the current
1. Macro definitions can be divided into 2 types:Macro definition with no parametersMacro definition with Parameters2. DefinitionGeneral form#define Macro Name stringLike #define ABC 10.The string on the right can also be omitted, such as # define ABC3. RoleIt is used to define constants by replacing all "macro names" in the source program with the right "strings
A macro with parameters defines a format that resembles the following:"#define Directive----macro with parameters" #define identifier (x1,x2,......, Xn)Where x1,x2,...... xn is a marker (the parameter of the Macro)Note: There is no space required between the name of the macro and the Parentheses.If there are spaces, pr
Table of Contents
1. Introduction
2. Usage
3. Parameters and Variables
4. Precautions
4.1. Macro can only be used for the following three kinds of variables:
4.2. Relationship with Block:
5. Reference documentation
1 IntroductionJINJA2 is the template engine for Python, and in the process of writing Python web use, it is found that macro can save a lot of
Now many friends in writing documents like to download various templates online to simplify their work. However, there are some "black sheep" in the network template that are not produced for the convenience of everyone, they carry a macro virus. Macro virus parasitic in templates or documents, when you run the document or template will activate the virus to harm the computer. But do not worry too much, we
First put a picture, this is the end of the road book display effect
1, demand--2, solutions--3, implementation Method--4, subsequent expansion
1. Demand
Demand is probably like, to achieve the progress of the book play, you can forward back, pause, when the mouse hover trolley display location information (callout)
Subsequent (playback speed modification)
2, solve the idea
The original idea: I threw a bu
Macro idea is a piece of program code with independent functions in the source program.Macro commands: User-defined commands. During programming, the functions used for multiple times are replaced by a macro command.
Compilation includes commands, pseudo commands, and macro commands. The first two are both defined, and the last one is designed by yourself.
The ad
Replacing macros with Inline:
1. inline functions can be debugged at runtime, but macro definitions cannot;2. the compiler checks the parameter types of inline functions for security or automatically converts the types (same as normal functions), but the macro definition does not;3. inline functions can be member variables of the callback class, while macro-defin
Many people must know about macros and may have used macros. What is Macros? A macro is a program compiled by VBA. It is a series of commands and functions stored in the Visual Basic module and can be run at any time when the task needs to be executed. How to start learning VBA? This is one of the frequently asked questions of many friends. I personally think that the best way to learn something is to start with interest. This is why this post is crea
*) (port)) = ((Byte) (val))#define OUTPW (Port, Val) (* (volatile word *) (port)) = ((Word) (val))#define OUTPDW (Port, Val) (* (volatile DWORD *) (port)) = ((DWORD) (Val)))19: Debug with some macro trackingThe ANSI standard describes five predefined macro names. They are:__line____file____date____time____stdc____cplusplus is also defined in C + +.If the compiler is not standard, it is possible to support
Replace macros with inline:
1. Inline functions can be debugged at run time, while macro definitions are not possible;2. The compiler will do security checks or automatic type conversions (with normal functions) on the parameter types of the function, while the macro definition will not;3. The inline function can access the member variables of the class, and the macro
1. How to view macro development
Before getting started, let's briefly introduce how a macro we define can be expanded in the referenced code. I use Microsoft Visual C ++ 6.0, project menu-> Settings, C/C ++ tabs, and add/P to project options, as shown in 1. Rebuild all will generate a. I file with the same name as. cpp. Open the. I file and you can see how macros are expanded in the code.
Figure 1 1 Add "
This article only mentions 2007, but 2010 can also be solved by this method!
Word2007 prompt Error "This error is usually caused by macro security settings"
Every time you run Word, a prompt window appears-"This error is usually caused by macro security settings." If you know that the macro is from a source that you trust, you can change the
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.