You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
1. A template is not a class or a function. A template is a “pattern” that the compiler uses to generate a family of classes or functions.
112
+
2. In order for the compiler to generate the code, it must see both the template definition (not just declaration) and the specific types/whatever used to “fill in” the template. For example, if you’re trying to use a Foo<int>, the compiler must see both the Foo template and the fact that you’re trying to make a specific Foo<int>.
113
+
3. Your compiler probably doesn’t remember the details of one .cpp file while it is compiling another .cpp file. It could, but most do not and if you are reading this FAQ, it almost definitely does not. BTW this is called the “`separate compilation model`.”
[Why can templates only be implemented in the header file?](http://stackoverflow.com/questions/495021/why-can-templates-only-be-implemented-in-the-header-file)
294
+
[Why can’t I separate the definition of my templates classfrom its declaration and put it inside a .cpp file? ](https://isocpp.org/wiki/faq/templates#templates-defn-vs-decl)
* REPEATABLE READ(可重复读):只允许读取已经提交的数据,而且`在一个事务两次读取一个数据项期间,其它事务不得更新该数据`。但该事务不要求和其它事务可串行化。可能存在`幻读`问题:当某个事物在读取某个范围内的记录时,另外一个事务又在该范围内插入了新的记录,当之前的事务再次读取该范围的记录时,会产生幻行。可重复读是 MySQL 的默认事务隔离级别。
0 commit comments