Cppref: reading cppreference.com docs offline, like man or info or perldoc
Today I created a tiny script called cppref, a wrapper for documents on cppreference.com. Blurbs are:
- docs are bundled with the interface, no network access required
- works like man(1) or info(2) or perldoc(2)
It looks like follows.
$ cppref
You are here: C++ Reference
C++ Reference
C++
General Topics * C++ Strings
* C++ I/O
* FAQ + C++ String Streams
* Pre-processor commands * C++ Exceptions
* Operator Precedence
* Escape Sequences C++ Standard Template Library (STL)
* ASCII Chart
* Data Types * Overview
* Keywords * Iterators
* C++ Algorithms
Standard C Library * C++ Vectors
* C++ Double-Ended Queues
* Overview * C++ Lists
* Standard C I/O * C++ Priority Queues
* Standard C String & Character * C++ Queues
* Standard C Math * C++ Stacks
* Standard C Time & Date * C++ Sets
* Standard C Memory * C++ Multisets
* Other standard C functions * C++ Maps
* C++ Multimaps
* C++ Bitsets
$ cppref vector
You are here: C++ Reference >> C++ Standard Template Library >> C++ Vectors
C++ Vectors
Vectors contain contiguous elements stored as an array.
Accessing members of a vector can be done in constant time, appending elements
to a vector can be done in amortized constant time, whereas locating a specific
value or inserting elements into the vector takes linear time.
Constructors create vectors and initialize them with some data
Operators compare, assign, and access elements of a vector
assign assign elements to a vector
at returns an element at a specific location
back returns a reference to last element of a vector
(snip)
Or if the specified term maps to multiple files,
$ cppref push_back
multiple choices:
stl::deque::push_back
stl::list::push_back
stl::vector::push_back
string::push_back
By default, cppref uses w3m as its viewer, so you can follow the links to read the documents.
Cppref is available from search.cpan.org/dist/cppref or github.com/kazuho/cppref. Hove fun!


Recent Comments