摘要:
阅读全文
摘要:
互斥量 Mutex 互斥量1. #include <pthread.h> 2. int pthread_mutex_init(pthread_mutex_t *mutex, const pthread_mutexattr_t *mutexattr); 3. 4. int pthread_mutex_ 阅读全文
摘要:
Rust 简介 使 Rust 显得独一无二的主要概念是“所有权”。考虑这个小例子:fn main() { let mut x = vec!["Hello", "world"];}这个程序创建了一个叫做x的变量绑定。这个绑定的值是一个Vec<T>,一个 vector,我们通过一个定义在标准库中的宏来创 阅读全文
摘要:
java的设计采用了单根结构,除去在GC上的好处之外,在泛型编程上(模板C++),因为所有的类型都继承自Object,因此利用向上塑型,我们是可以写出如下的代码: public class GenericTest { public static void main(String[] args) { 阅读全文
摘要:
Structured Exception Handling是windows特有的异常处理,SEH包含了两个方面的功能: • 终止处理 • 异常处理 终止处理: 终止处理确保无论被保护代码是如何退出的,另一个代码块总能被调用和执行: __try { //Guarded Body … } __final 阅读全文
摘要:
引言 Understanding how deleters work in Boost’s shared_ptr, 2004. Boost’s reference-counting smart pointer shared_ptr has the interesting characteristic 阅读全文
摘要:
由.proto文件生成C++的相关文件时,一个对应的的类和相关功能的对应关系如下: Varint的相关实现(节省大小,小的数字从4个字节变为一个字节): 对于编码,遇到的第一个字节,需要检查高位,如果高位为0,说明这个最后个byte,使用剩余的7位标识真实的值,在这种情况下,最大表示的值是2^7(1 阅读全文