background preloader

Libraries

Facebook Twitter

Standard Template Library. The STL provides a ready-made set of common classes for C++, such as containers and associative arrays, that can be used with any built-in type and with any user-defined type that supports some elementary operations (such as copying and assignment).

Standard Template Library

STL algorithms are independent of containers, which significantly reduces the complexity of the library. Composition[edit] Containers[edit] Iterators[edit] The STL implements five different types of iterators. It is possible to have bidirectional iterators act like random access iterators, as moving forward ten steps could be done by simply moving forward a step at a time a total of ten times. This generality also comes at a price at times. Algorithms[edit] A large number of algorithms to perform operations such as searching and sorting are provided in the STL, each implemented to require a certain level of iterator (and therefore will work on any container that provides an interface by iterators).

The Standard Template Library: Introduction. The Standard Template Library, or STL, is a C++ library of container classes, algorithms, and iterators; it provides many of the basic algorithms and data structures of computer science.

The Standard Template Library: Introduction

The STL is a generic library, meaning that its components are heavily parameterized: almost every component in the STL is a template. You should make sure that you understand how templates work in C++ before you use the STL. Containers and algorithms Like many class libraries, the STL includes container classes: classes whose purpose is to contain other objects. The STL includes the classes vector, list, deque, set, multiset, map, multimap, hash_set, hash_multiset, hash_map, and hash_multimap. Vector<int> v(3); // Declare a vector of 3 elements. v[0] = 7; v[1] = v[0] + 3; v[2] = v[0] + v[1]; // v[0] == 7, v[1] == 10, v[2] == 17 The STL also includes a large collection of algorithms that manipulate the data stored in containers.

C++ STL Tutorial. The Standard Template Libraries (STL's) are a set of C++ template classes to provide common programming data structures and functions such as doubly linked lists (list), paired arrays (map), expandable arrays (vector), large string storage and manipulation (rope), etc.

C++ STL Tutorial

The STL library is available from the STL home page. This is also your best detailed reference for all of the STL class functions available. Also see our C++ Templates tutorial STL can be categorized into the following groupings: Container classes: Sequences: vector: (this tutorial) Dynamic array of variables, struct or objects. Also see the YoLinux.com GDB tutorial on dereferencing STL containers. vector: Dynamic array of variables, struct or objects. Simple example of storing STL strings in a vector. Zlib Home Site. JsonCpp - JSON data format manipulation library. How to install JsonCpp in Ubuntu and use it in Eclipse. You need to follow these instructions (I slightly modified this installing guide for Mac OS X) to install JsonCpp in Ubuntu and use it from Eclipse: 1.

How to install JsonCpp in Ubuntu and use it in Eclipse

Download JsonCpp from here. 2. Create a new folder decompress and extract JsonCpp there: $ mkdir /home/youruser/JsonCpp $ tar xzf /home/youruser/JsonCpp/jsoncpp-src-0.5.0.tar.gz 3. . $ tar xzf /home/youruser/JsonCpp/jsoncpp-src-0.5.0/scons-local-1.3.0.tar.gz 4. 5. . $ cd /home/youruser/JsonCpp/jsoncpp-src-0.5.0 $ python scons.py platform=linux-gcc check 5. . $ sudo cp /home/youruser/JsonCpp/jsoncpp-src-0.5.0/libs/linux-gcc-4.4.5/libjson_linux-gcc-4.4.5_libmt.so /usr/lib $ sudo mkdir /usr/include/jsoncpp $ sudo cp /home/youruser/JsonCpp/jsoncpp-src-0.5.0/include/json/* /usr/include/jsoncpp/ 6.

That's all you need to start using JsonCpp in Eclipse.