Ubuntu18.04 man C++函数库

Ubuntu18.04 man C++函数库,第1张

为了避免造成 *** 作系统、C语言与C++的混淆,目前安装的C++ man pages与直接查询C语言标准函数不同,需要加上命名空间的限制:
# man namespace::function : 标准库函数查询
# man namespace::header : 标准头文件查询
# man namespace::class : 一些标准库中类的查询


注意:man C++的函数库只能man到类和文件这一级别,然后去类里搜索查看的函数即可。

栗子:

如果想查看swap()函数,因为swap在iostream类里包含

# man std::iostream //然后在iostream类里查找swap函数即可。

1.安装C++函数库文档
# sudo apt install libstdc++-8-doc

注意:一定要下载最新版的离线man文档,否则C++新特性可能没有办法man出来。
2.第二种安装方式
下载地址:
http://archive.ubuntu.com/ubuntu/pool/main/g/gcc-8/libstdc++-8-doc_8-20180414-1ubuntu2_all.deb

2.使用
# man std::vector
   Public Member Functions
       vector ()
       vector (const allocator_type &__a)
       vector (size_type __n, const allocator_type &__a=allocator_type())
       vector (size_type __n, const value_type &__value, const allocator_type 

# man std::iostream
std::basic_iostream< _CharT, _Traits >(3cxx)                                                                                                                std::basic_iostream< _CharT, _Traits >(3cxx)

NAME
       std::basic_iostream< _CharT, _Traits > - Template class basic_iostream.

SYNOPSIS
       Inherits std::basic_istream< _CharT, _Traits >, and std::basic_ostream< _CharT, _Traits >.

       Inherited by std::basic_fstream< _CharT, _Traits >, and std::basic_stringstream< _CharT, _Traits, _Alloc >.

   Public Types
       typedef ctype< _CharT > __ctype_type
       typedef ctype< _CharT > __ctype_type

欢迎分享,转载请注明来源:内存溢出

原文地址:https://54852.com/langs/872927.html

(0)
打赏 微信扫一扫微信扫一扫 支付宝扫一扫支付宝扫一扫
上一篇 2022-05-13
下一篇2022-05-13

发表评论

登录后才能评论

评论列表(0条)

    保存