<bits/stdc++.h>头文件介绍(包含源代码)
注:转自http://blog.csdn.net/charles_dong2/article/details/56909347,同为本人写的,有部分修改。
之前在一个小OJ上刷题时发现有人是这么写的:
#include <bits/stdc++.h>
...
百度了一下,发现<bits/stdc++.h>包含了全部的C++头文件。这样做题时直接敲上一句#include <bits/stdc++.h>而不是很多个#include。很方便,对吧?
不过注意,目前POJ还不支持<bits/stdc++.h>(G++、C++都不支持)。HDU部分支持(G++支持,C++不支持)。
下面是<bits/stdc++.h>的源代码(IDE为Dev-C++ 5.11)。吐槽一句:网上有很多关于这个头文件的文章,但没有一个列出完整的内容。不过列出也没有什么用,呵呵。
// 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
<bits/stdc++.h>头文件介绍(包含源代码)的更多相关文章
- #include <bits/stdc++.h>头文件
这实际上就是一个头文件的集合,可以看看他的定义. #ifndef _GLIBCXX_NO_ASSERT #include <cassert> #endif #include <cct ...
- Vscode配置C++运行环境(2019/1//11更)并加入bits/stdc++.h头文件
因为重装系统,以前配置好的c++环境又没了.所以有要配置一遍. 1 下载mingw64或minw, 配置好环境变量:C://mingw64//bin; 在cmd下用g++ -v验证是否成功. 2. ...
- Visual Studio 中使用万能头文件 #include <bits/stdc++.h>
最近开始使用VS,之前用的DEV C++软件可直接使用 #include <bits/stdc++.h> ,但VS中并没有,为了使用方便,可直接在VS中添加此头文件,方法如下: 1.在安 ...
- 万能头文件#include<bits/stdc++.h>
最近在打cf时赛后翻阅别人的代码总是会发现一个陌生而奇怪的头文件#include<bits/stdc++.h> 奇怪之处就在于基本上所有的代码只要用了这个头文件就不再写其他头文件了. 百度 ...
- 高级c++头文件bits/stdc++.h
用这种方法声明头文件只需两行代码 #include<bits/stdc++.h> using namespace std; 这个头文件包含以下等等C++中包含的所有头文件: #includ ...
- 2.头文件<bits/stdc++.h>
用这种方法声明头文件只需两行代码 #include<bits/stdc++.h> using namespace std; 这个头文件包含以下等等C++中包含的所有头文件: #inclu ...
- C++头文件#include<bits/stdc++.h>
一句话的事,直截了当——#include<bits/stdc++.h>包含C++的所有头文件 参考网站(点击):http://www.tuicool.com/articles/m6neUj ...
- 万能头文件#include <bits/stdc++.h>
最近在做题的时候看到别人的题解发现别人都用这个 突然之间打开新世界的大门 去百度之后才知道#include <bits/stdc++.h>包含了目前所有的c++头文件 也就是说只要用#in ...
- C++头文件<bits/stdc++.h>
在刷题时,总发现有的只写一行头文件 #include <bits/stdc++.h> . 查阅资料后,才知道原来:#include<bits/stdc++.h>包含了目前c++ ...
随机推荐
- js的break语句,continue语句,return语句
js的break语句,continue语句,return语句. 用的时候很容易混淆,有过一次泪奔的经历. break语句 break语句会使运行的程序立刻退出包含在最内层的循环或者退出一个switch ...
- bzoj4827 [Hnoi2017]礼物
Description 我的室友最近喜欢上了一个可爱的小女生.马上就要到她的生日了,他决定买一对情侣手 环,一个留给自己,一个送给她.每个手环上各有 n 个装饰物,并且每个装饰物都有一定的亮度.但是在 ...
- 如何修改dmesg log buffer size
CONFIG_LOG_BUF_SHIFT: Kernel log buffer size (16 => 64KB, 17 => 128KB) General informations Th ...
- PHP 安装 phpredis 扩展(二)
本文主要介绍为 PHP 安装 phpredis 扩展,并用 PHP 代码连接 Redis 服务器. 一.安装 phpredis 扩展 1. Linux.macOS 下安装 #. 下载.解压.安装.编译 ...
- 小谈ThinkPHP
ThinkPHP也是一个MVC框架,分视图.控制器和模型,和Yii框架相比相对较好理解,并且是轻量级的框架(相对于Yii来说),在使用Yii框架时候如果将框架放在项目文件中,用编辑器打开文件都比较慢, ...
- Docker - 容器直连
本文是在原文基础上的实际操作验证记录和细节补充. 默认情况下,容器连接到虚拟网桥docker0提供的虚拟子网中,容器之间通过默认网关(虚拟网桥docker0接口地址)建立连接. 如果不使用虚拟网桥,用 ...
- 工具类总结---(三)---MD5加密
用于给文件名等进行MD5加密: import java.security.MessageDigest; import java.security.NoSuchAlgorithmException; / ...
- 用ng-view创建单页APP
我们假设我们有一个单页面的程序,并且想为这个页面添加动画效果.点击某一个链接会将一个试图滑出,同时将另一个试图滑入. 我们将会使用: 使用 ngRoute 来为我们的页面路由 使用 ngAnimate ...
- git pull冲突:commit your changes or stash them before you can merge.
今天用git pull来更新代码,遇到了下面的问题: error: Your local changes to the following files would be overwritten by ...
- java环境安装之不能安装exe文件
经过多年,打算再学下java 从官网下载java8安装包,但因为我的计算机的cd-room被卸载掉了,安装是报错说cab文件损坏之类的错误. 从stackOverflow中找到一篇眼前一亮的解决办法. ...