注:转自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>头文件介绍(包含源代码)的更多相关文章

  1. #include <bits/stdc++.h>头文件

    这实际上就是一个头文件的集合,可以看看他的定义. #ifndef _GLIBCXX_NO_ASSERT #include <cassert> #endif #include <cct ...

  2. Vscode配置C++运行环境(2019/1//11更)并加入bits/stdc++.h头文件

    因为重装系统,以前配置好的c++环境又没了.所以有要配置一遍. 1 下载mingw64或minw, 配置好环境变量:C://mingw64//bin;  在cmd下用g++ -v验证是否成功. 2. ...

  3. Visual Studio 中使用万能头文件 #include <bits/stdc++.h>

    最近开始使用VS,之前用的DEV C++软件可直接使用 #include <bits/stdc++.h>  ,但VS中并没有,为了使用方便,可直接在VS中添加此头文件,方法如下: 1.在安 ...

  4. 万能头文件#include<bits/stdc++.h>

    最近在打cf时赛后翻阅别人的代码总是会发现一个陌生而奇怪的头文件#include<bits/stdc++.h> 奇怪之处就在于基本上所有的代码只要用了这个头文件就不再写其他头文件了. 百度 ...

  5. 高级c++头文件bits/stdc++.h

    用这种方法声明头文件只需两行代码 #include<bits/stdc++.h> using namespace std; 这个头文件包含以下等等C++中包含的所有头文件: #includ ...

  6. 2.头文件<bits/stdc++.h>

    用这种方法声明头文件只需两行代码 #include<bits/stdc++.h> using namespace std; 这个头文件包含以下等等C++中包含的所有头文件:  #inclu ...

  7. C++头文件#include<bits/stdc++.h>

    一句话的事,直截了当——#include<bits/stdc++.h>包含C++的所有头文件 参考网站(点击):http://www.tuicool.com/articles/m6neUj ...

  8. 万能头文件#include <bits/stdc++.h>

    最近在做题的时候看到别人的题解发现别人都用这个 突然之间打开新世界的大门 去百度之后才知道#include <bits/stdc++.h>包含了目前所有的c++头文件 也就是说只要用#in ...

  9. C++头文件<bits/stdc++.h>

    在刷题时,总发现有的只写一行头文件 #include <bits/stdc++.h> . 查阅资料后,才知道原来:#include<bits/stdc++.h>包含了目前c++ ...

随机推荐

  1. oracle定时执行一个存储过程

    首先需要新建存储过程 一 存储过程: create or replace procedure Insertdata is begin INSERT INTO tab_dayta select * fr ...

  2. 统计学习方法:KNN

    作者:桂. 时间:2017-04-19  21:20:09 链接:http://www.cnblogs.com/xingshansi/p/6736385.html 声明:欢迎被转载,不过记得注明出处哦 ...

  3. 感觉不止被Q了一下,还不知道被谁套了一个虚弱

    最近身体出现了一些问题,导致博客无法正常更新,只能是看身体状态更新了,相信用不了半个月就会满血复活的,请谅解 Joker在这里提醒大家  身体是革命的本钱,不要透支,不要过度消耗

  4. mybatis插入List集合数据

    处女帖 今天做完一个定时任务将一个表中的数据每天统计到另外一个表中,开始是用循环的方式向数据库添加,觉得数据库可能访问压力过大,所以就使用了mybatis的foreach标签来稍微的减少压力. 首先封 ...

  5. 记一些让footer始终位于网页底部的方法

    上次说把网页的头部和尾部分离出来作为一个单独的文件,所有网页共用,这样比较方便修改,然而,,,我发现某些方法里尾部会紧跟在头部后面,把内容挤在下面..而且有的页面内容少的话不能把尾部挤到最下面,所以, ...

  6. linux基础 作业篇

    1.自动部署反向代理 web nfs #!/usr/bin/python #-*- coding:utf-8 -*- #开发脚本自动部署及监控 #1.编写脚本自动部署反向代理.web.nfs: #!/ ...

  7. js 时间时间戳互换

    <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="C ...

  8. .net应用程序中添加chm帮助文档打开显示此程序无法显示网页问题

    在做.net大作业时添加了chm帮助文档结果在打开时显示“此程序无法显示网页问题”,但是把帮助文档拷到别的路径下却显示正常, 经过从网上查找,终于找到了答案: (1).chm文件的路径中不能含有“#” ...

  9. python 错误之SyntaxError: Missing parentheses in call to 'print'

    SyntaxError: Missing parentheses in call to 'print' 由于python的版本差异,造成的错误. python2: print "hello ...

  10. springmvc 导出excel

    1.pom.xml <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www ...