排序
C++11新特性之八:smart pointers
一.智能指针的作用 C++程序设计中使用堆内存是非常频繁的操作,堆内存的申请和释放都由程序员自己管理。程序员自己管理堆内存可以提高了程序的效率,但是整体来说堆内存...
C++11新特性之十三:std::make_unique和std::make_shared
原标题:比起直接使用new,更偏爱使用std::make_unique和std::make_shared 让我们从std::make_unique和std::make_shared之间的比较开始讲起吧。std::make_shared是C++11...
C++11新特性之十:enable_shared_from_this
enable_shared_from_this是一个模板类,定义于头文件<memory>,其原型为: template< class T > class enable_shared_from_this; std::en...
C++11新特性之十二:std::all_of, std::any_of, std::none_of
一.std::any_of any_of与下列函数等效: template<class InputIterator, class UnaryPredicate> bool any_of (InputIterator first, InputIterator last, UnaryPredicate pred) ...
C++11新特性之四:range-based for loops
熟悉C++98/03的对于for循环就再了解不过了,如果我们要遍历一个数组,那么在C++98/03中的实现方式: int arr[10] = { 1, 2, 3, 4, 5, 6, 7, 8, 9, ...
C++11新特性之六:list-initialization
在我们实际编程中,我们经常会碰到变量初始化的问题,对于不同的变量初始化的手段多种多样,比如说对于一个数组我们可以使用 int arr[] = {1,2,3}的方式初始化,...