经常看人写#include <bits/stdc++.h>却不知道是干啥的?

#include<bits/stdc++.h>包含了目前c++所包含的所有头文件

对比:

#include <iostream>
#include <cstdio>
#include <fstream>
#include <algorithm>
#include <cmath>
#include <deque>
#include <vector>
#include <queue>
#include <string>
#include <cstring>
#include <map>
#include <stack>
#include <set>
using namespace std; int main(){ return ;
}
 #include<bits/stdc++.h>
using namespace std; int main(){ return ;
}

这么神奇?可以这么轻松?

兼容性问题:

注意,目前POJ还不支持<bits/stdc++.h>(G++、C++都不支持)。HDU部分支持(G++支持,C++不支持)。

其他国外的oj,还有台湾的oj都支持,CF,Topcoder也都支持。

当然,其实这是一个偷懒的写法,但是会降低编译速度(为何会降低编译速度,我还不能知道,等到之后学编译原理再来填坑吧)。

笔试平台可以使用,方便,VS中并不支持,一般G++ 4.4以上就支持这个头文件了。当然,私下自己学习就不要去使用了,对你的自主学习一点都没有好处。

c++11支持这个

<bits/stdc++.h>的源代码

// C++ includes used for precompiling -*- C++ -*-

// Copyright (C) 2003-2014 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 3, or (at your option)
// any later version. // This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details. // Under Section 7 of GPL version 3, you are granted additional
// permissions described in the GCC Runtime Library Exception, version
// 3.1, as published by the Free Software Foundation. // You should have received a copy of the GNU General Public License and
// a copy of the GCC Runtime Library Exception along with this program;
// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
// <http://www.gnu.org/licenses/>. /** @file stdc++.h
* This is an implementation file for a precompiled header.
*/ // 17.4.1.2 Headers // C
#ifndef _GLIBCXX_NO_ASSERT
#include <cassert>
#endif
#include <cctype>
#include <cerrno>
#include <cfloat>
#include <ciso646>
#include <climits>
#include <clocale>
#include <cmath>
#include <csetjmp>
#include <csignal>
#include <cstdarg>
#include <cstddef>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime> #if __cplusplus >= 201103L
#include <ccomplex>
#include <cfenv>
#include <cinttypes>
#include <cstdalign>
#include <cstdbool>
#include <cstdint>
#include <ctgmath>
#include <cwchar>
#include <cwctype>
#endif // C++
#include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <exception>
#include <fstream>
#include <functional>
#include <iomanip>
#include <ios>
#include <iosfwd>
#include <iostream>
#include <istream>
#include <iterator>
#include <limits>
#include <list>
#include <locale>
#include <map>
#include <memory>
#include <new>
#include <numeric>
#include <ostream>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <stdexcept>
#include <streambuf>
#include <string>
#include <typeinfo>
#include <utility>
#include <valarray>
#include <vector> #if __cplusplus >= 201103L
#include <array>
#include <atomic>
#include <chrono>
#include <condition_variable>
#include <forward_list>
#include <future>
#include <initializer_list>
#include <mutex>
#include <random>
#include <ratio>
#include <regex>
#include <scoped_allocator>
#include <system_error>
#include <thread>
#include <tuple>
#include <typeindex>
#include <type_traits>
#include <unordered_map>
#include <unordered_set>
#endif

最新文章

  1. ORA-02020 : 过多的数据库链接在使用中-Windows环境解决步骤
  2. 欧洲宇航局(ESA)的协同设计室(CDF)
  3. MainWndProc运行观察
  4. Raphael 目标点沿路径不断移动
  5. [SQL Server]树形结构的创建
  6. WPF常用数据绑定控件集合
  7. YII编码规范
  8. ES6-模块化
  9. CDH 集群机器上部署 Jupyter notebook 使用 Pyspark 读取 Hive 数据库
  10. IDEA ----Apachemaven连接私服,mavenWed工程 、以及Tomcat配置和项目的部署
  11. HTML 中使用 JavaScript
  12. Docker容器中开始.Net Core之路
  13. 为何CPU散片这么便宜?盒装CPU值得买吗
  14. 【oracle入门】数据完整性约束
  15. Unity 5 Game Optimization (Chris Dickinson 著)
  16. Yii2-设置和获取、删除Cookies空值分析(有代码)
  17. MySQL中的三中循环 while 、 loop 、repeat 求 1~n 的和
  18. MapReduce运行原理
  19. CentOS 7更换yum源
  20. inside、outside和dmz之间的访问

热门文章

  1. B1071 小赌怡情 (15分)
  2. 15.8,redis-cluster配置
  3. MyBatis---自动创建表
  4. Hibernate---实体类注释简介
  5. Myeclipse代码格式化的样式和保存自动格式化
  6. Android如何实现毛玻璃效果之Android高级模糊技术
  7. HTTP协议中POST方法和GET方法有那些区别?
  8. Python 绘制棋盘
  9. linux_shell基础-变量、数组、运算符
  10. Escape From The Earth 逃离地球