![](https://img-blog.csdnimg.cn/20201014180756724.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
C++11
_The_Great_Gatsby_
这个作者很懒,什么都没留下…
展开
-
C++11 bind取代bind1st,bind2nd的用法
bind2nd的用法:int a[] = {1, 2, 3, 4};std::vector< int> arr(a, a + 4);// 移除所有小于3的元素arr.erase( std::remove_if( arr.begin(), arr.end(), std::bind2nd( std::less< int>(), 3)), arr.end()...原创 2018-09-14 10:44:05 · 1909 阅读 · 0 评论 -
C++在windows与linux下编译动态库
一、.so与.dll比较1、.so的单独编译链接从网上找的一个例子:头文件:so_test.h三个.c文件:test_a.c test_b.c test_c.c//so_test.h#include "stdio.h"void test_a();void test_b();void test_c();//test_a.c#include "so_test...原创 2019-09-12 16:21:36 · 1179 阅读 · 0 评论 -
C++中的模板
1、template的用法两种声明方式:template <class Type>template <typename Type>1)函数模板#include <stdio.h>template<typename T> void swap(T& t1, T& t2) { T tmpT; tmpT...原创 2019-09-16 11:52:48 · 242 阅读 · 0 评论 -
C++单例模式
1、不做任何扩展,全局只存在一个对象#include <iostream>using namespace std;class CSingleton{private: CSingleton() //构造函数是私有的 { } //防止发生拷贝,同时存在多个对象 CSingleton(const CSingleton &); CSingleton &a...原创 2019-09-17 15:14:54 · 109 阅读 · 0 评论