前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
社区首页 >专栏 >C++头文件中的bits/stdc++.h——万能头文件

C++头文件中的bits/stdc++.h——万能头文件

作者头像
种花家的奋斗兔
发布于 2020-11-13 06:15:02
发布于 2020-11-13 06:15:02
2.1K00
代码可运行
举报
运行总次数:0
代码可运行

看别人写代码的时候经常发现这样一个头文件

#include<bits/stdc++.h>

这是个什么东西呢?后来终于好奇百度了一下:

原来这个是个万能的头文件,其中包含了基本上所有的平时需要用的头文件,如下:

代码语言:javascript
代码运行次数:0
运行
AI代码解释
复制
// 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

所以,以后只要包含上这个头文件,就不用再写一大堆头文件了,也不用担心写一个函数,编译之后告诉你没有定义了,以后写代码,就决定是你了!

本文参与 腾讯云自媒体同步曝光计划,分享自作者个人站点/博客。
原始发表:2019/04/03 ,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体同步曝光计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
暂无评论
推荐阅读
编辑精选文章
换一批
GNU Radio之OFDM Divide和Matrix Transpose底层C++实现
gr-radar 中的 OFDM Divide 模块是GNU Radio中的一个组件,专门用于处理正交频分复用(OFDM)信号。这个模块主要执行复数信号的除法操作,通常用于雷达和通信系统中的信号处理。
Gnep@97
2024/05/26
1140
GNU Radio之OFDM Divide和Matrix Transpose底层C++实现
C++ 中使用 `<bits/stdc++.h>` 的利与弊
C++ 中的 <bits/stdc++.h> 是一个非常特殊的头文件。使用这个头文件可以包括 C++ 标准库中几乎所有的头文件,使得编写代码变得快速而简单。然而,它也带来了一些缺点。接下来,我们将深入探讨其优缺点,并通过具体案例加以说明。
GeekLiHua
2025/01/21
1790
VS环境下C++万能头文件报错的解决方法
今天我想要在C++中嵌入汇编语言来进行混合编程,发现一个小问题:VS或者VC++好像都不支持我最爱的C++万能头文件<bits/stdc++.h>,编译器会报错哒。下面就来说一下怎么才能让VS用上这个万能头文件吧。
喜欢ctrl的cxk
2019/11/07
3.1K0
是的,开源真的很酷
最近某事件沸沸扬扬,我不小心参与进issue好心提醒它们关闭无关话题,但不幸的是,遭到了邮件骚扰(好吧,其实是我不知道怎么取消issue的邮件推送:(
姓王者
2024/11/23
600
eva0.4.1源码看看3
/*************************************************************************** * Copyright (C) 2004 by yunfan * * yunfan_zg@163.com * *
py3study
2020/01/14
4610
【C++100问】深度总结STL基本容器的使用
文章首发于本人CSDN账号:https://blog.csdn.net/tefuirnever
我是管小亮
2020/04/20
1.2K0
BFGS优化算法的C++实现
* Copyright (c) 2008-2011 Zhang Ming (M. Zhang), zmjerry@163.com
用户7886150
2021/02/11
8920
解决GNU Radio+USRP实现OFDM收发在接收端QPSK星座图映射无“抖动”问题
本文记录在 GNU Radio+USRP 实现 OFDM 收发时,在接收端 QPSK 星座图映射无“抖动”问题的解决方法,
Gnep@97
2024/03/30
3260
解决GNU Radio+USRP实现OFDM收发在接收端QPSK星座图映射无“抖动”问题
C99标准里的inttypes.h头文件
其中的PRIu32是什么意思?上网搜了一下才知道是C99标准里新引入的宏定义,如下:
用户7886150
2021/02/20
1.5K0
c万能头文件名_vs不能用万能头文件
我们在写c++程序时是否遇到过因为没有导入库文件而导致报错,或者多次导入库文件时导致重复导入?这时我们就可以使用万能头文件(#include <bits/stdc++.h)
全栈程序员站长
2022/11/17
5050
glib和glibc_libc.so.6 version GLIBC_2.14
转自:http://blog.csdn.net/yasi_xi/article/details/9899599
全栈程序员站长
2022/09/20
1.8K0
Android Ndk and Opencv Development 1
从本节开始之后的几节将介绍关于Android NDK和OpenCV整合开发的内容,本节介绍Android NDK 和 OpenCV 整合开发的环境搭建以及人脸检测项目的运行测试。
宅男潇涧
2018/08/01
6780
Android Ndk and Opencv Development 1
【C++】考研408代码题【必会】【收藏】
浮点有精度限制 一旦涉及计算 就会导致舍入,所以 要用数学表达 非常接近 就是||<epsilon
20岁爱吃必胜客
2022/11/13
4200
【C++】考研408代码题【必会】【收藏】
php QR Code二维码生成类
<?php /* * PHP QR Code encoder * * This file contains MERGED version of PHP QR Code library. *
joshua317
2018/04/10
2.7K0
万能头文件可能产生的副作用_头文件使用std
可能有些大型比赛会禁止使用这个头文件,我个人建议,大家尽量还是熟悉原来的文件比较好哈,要是比赛时实在忘了可以应急使用
全栈程序员站长
2022/09/23
8490
如何编写自己的Arduino库?
一开始写Arduino 的时候很不习惯,没有main函数,因为好多东西都被隐藏了。一直想搞清楚,以便编写自己的库文件。于是研究一下午,下面是一些总结。
云深无际
2020/08/18
2.3K0
如何编写自己的Arduino库?
深夜里安静的编译一个OpenJDK8,坑太多
http://static.cyblogs.com/QQ20200524-035223@2x.jpg
chengcheng222e
2021/11/04
1.4K0
GUN 意思
http://blog.csdn.net/luoweifu/article/details/50153461
bear_fish
2018/09/19
3.2K0
【小码匠自习室】CSP-J/S复赛准备:CodeBlocks编辑器
问题: code::blacks调试代码时,默认是不能查看STL数据结构得值,只能看到内存地址,调试起来会很不爽
小码匠
2022/12/06
1.3K0
【小码匠自习室】CSP-J/S复赛准备:CodeBlocks编辑器
开源在线编辑复合自动图表
很多企业的业务对标准数据图表有很多的业务系统需求,而开发的节奏一直跟不上的。在报表开发中,很多的企业的流程是这样的: 1、BI负责数据的获取整合加工; 2、业务部门负责自己数据的展示。 作为业务部门,我们拿到已经整理的数据有多种提供形式: 1、接口,BI开发对应的数据接口,业务部门对接; 2、数据库,BI将具体的数据存储相应的数据库; 3、搜索引擎,BI将数据明细整理到搜索引擎。 4、缓存,BI写入实时计算的技术到缓存中。 所以在一段时间以内,我们的报表一直有前后端的资源投放在这些胶水代码的编写中。刚好的在武汉疫情爆发的这段时间,我有了一些闲暇的时间,解决这个问题,而把我的这个事情从Todo List中移除。
openapplus
2020/02/24
1.1K0
开源在线编辑复合自动图表
相关推荐
GNU Radio之OFDM Divide和Matrix Transpose底层C++实现
更多 >
领券
社区富文本编辑器全新改版!诚邀体验~
全新交互,全新视觉,新增快捷键、悬浮工具栏、高亮块等功能并同时优化现有功能,全面提升创作效率和体验
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档
查看详情【社区公告】 技术创作特训营有奖征文