"Universal Reference" and Reference Collapsing

This post is just to note down an interesting talk: Universal References in C++11 , presented by Scott Meyers at C++ and Beyond 2012 . The talk shares a good method to understand (or memorize) the rvalue reference and reference collapsing rules in modern C++, with the help of his self-created concept called Univeral …

C/C++ 存储区知识

bss 段:存放未初始化的全局变量(包括静态全局变量)和初始化为0的全局变量(包括静态全局变量),属于静态分配内存(bss = Block Started by Symbol) data 段:数据段,用来存放已经初始化且初始化值为非零的全局变量(包括静态变量) text 段:通常是指用来存放程序执行代码的一块内存区域。这部分区域的大小在程序运行前就已经确定,并且内存区域通常属于只读,某些架构也允许代码段为可写,即允许修改程序。 堆(heap):堆是用于存放进程运行中被动态分配的内存段,它的大小并不固定,可动态扩张或缩减。当进程调用malloc等函数分配内存时,新分配的内存就被动态添加到堆上(堆被扩张);当利用free等函数释放内存 …