1 Star 0 Fork 10

jjzhang166 / libicon

forked from gite-hub / libicon 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
_cpp.h 1.38 KB
一键复制 编辑 原始数据 按行查看 历史
7-wolf 提交于 2019-07-24 13:13 . 添加项目文件。
#pragma once
// C++
#include <string>
#include <math.h>
#include <functional>
// STL
#include <array>
#include <vector>
#include <set>
#include <map>
#include <algorithm>
// 无符号
typedef unsigned char uchar;
typedef unsigned short ushort;
typedef unsigned int uint;
typedef unsigned long ulong;
typedef unsigned __int64 u64;
////////////////////////////////////////////////////////////////////////// delete
#define ccc_delete(_p_) if(_p_ != nullptr){delete _p_; _p_ = nullptr;}
#define ccc_delete_array(_p_) if(_p_ != nullptr){delete[] _p_; _p_ = nullptr;}
#define ccc_delete_array1(_p_, _n_)\
if(_p_)\
{\
for(int _i_ = (_n_) - 1; _i_ >= 0; --_i_)\
{\
ccc_delete(_p_[_i_])\
}\
delete[] _p_;\
_p_ = nullptr;\
}
#define ccc_delete_array2(_p_, _n_)\
if(_p_ != nullptr)\
{\
for(int _i_ = (_n_) - 1; _i_ >= 0; --_i_)\
{\
ccc_delete_array(_p_[_i_])\
}\
delete[] _p_;\
_p_ = nullptr;\
}
////////////////////////////////////////////////////////////////////////// STL
// 正序for
#define forr(_vect_,_i_) for(int _i_ = (int)_vect_.size() - 1; _i_ >= 0; --_i_)
// 反序for
#define forv(_vect_,_i_) for(int _size_ = (int)_vect_.size(), _i_ = 0; _i_ < _size_; ++_i_)
// 通用查找容器迭代器
#define ccc_find_it(_STL_, _V_) std::find(_STL_.begin(), _STL_.end(), _V_)
// 容器能否找到元素
#define ccc_find(_STL_, _V_) (ccc_find_it(_STL_, _V_) != _STL_.end())
// #define push_back emplace_back
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
C++
1
https://gitee.com/jjzhang166/libicon.git
git@gitee.com:jjzhang166/libicon.git
jjzhang166
libicon
libicon
master

搜索帮助

344bd9b3 5694891 D2dac590 5694891