Standard Template Library in C++

learn more… | top users | synonyms

3
votes
2answers
213 views

What's wrong with statically linking the STL into multiple shared libraries?

Here is the scenario: libA.so and libB.so both statically link to the same STL. libA.so has a public API that returns a std::string. libB.so calls this function and receives a copy of the string. ...
1
vote
4answers
437 views

Wrapper around C++ STL

Where I work we have our own system library, which pretty much is only wrappers around the STL, such as: template <typename T> class HVector { protected: std::vector<T> data; public: ...
2
votes
0answers
110 views

Why isn't there parallel reduction in the Standard Template Library?

Alexander Stepanov stated in talks and interviews that his realization that eventually lead him to generic programming and the Standard Template Library, was from the case of the parallel reduction ...
5
votes
3answers
170 views

Are there languages that expand on the STL's iterator types? [closed]

Many languages use the concept of an iterator. The c++ STL expands on this with input iterators, output iterators, forward, bidirectional, random access and others. As far as I know, these ...
0
votes
3answers
2k views

Two-Dimensional vector in C++ – inefficient with dynamic-sized sub vectors?

I know that std::vector uses a contiguous block of memory, but I often see people use vectors of vectors, even when they modify the number of elements in these vectors contained within an outer ...
11
votes
3answers
4k views

QT-C++ vs Generic C++ and STL [closed]

Been brushing up on my C++ lately, on Ubuntu QQ. I love the Qt framework for everything, especially building GUI's. I became quite familiar with it when using PyQt over the last few years. When ...
2
votes
2answers
579 views

How do objects fit into modern C++ (stl, policy-classes, functional) style?

I'm a bit confused so the question is a bit confusing. TL;dr: how to mix STL and OOP? From the comment to Best overview to modern C++ paradigms? and ...
8
votes
4answers
11k views

What is the point of using lists over vectors, in C++?

I've run 3 different experiments involving C++ lists and vectors. Those with vectors proved more efficient, even when a lot of insertions in the middle were involved. Hence the question: in which ...
4
votes
1answer
319 views

How does a priority_queue maintain a heap on a deque efficiently?

In the C++ STL, priority_queue (heap) can be used with any underlying container, such as a deque. How does the implementation stay O(log n) if deques don't swap an item in index a with index b in ...
0
votes
4answers
1k views

Why is using classic for loops as iterators in stl considered bad?

I've read a couple of articles (example) that consider the classic for (int ...... size() .... i++) loop bad practice when iterating through for example vectors in stl. Instead the recommended why ...
11
votes
5answers
4k views

Is it practical to abandon STL in C++ development?

I know in some areas (game industry, for example), STL is not recommended. So my question is: is it really a good practice not to use STL in some cases? If so, what's the biggest reasons of not using ...
2
votes
4answers
4k views

What sorting algorithm does STL use?

I recently started using <vector.h> library and I was wondering, since all the operations are already implemented, IF the method of the sorting algorithm is the most efficient one. Everything ...
2
votes
4answers
369 views

What kind of interface should a double container offer?

I want to write a class which offers two sequences of elements to its users. The first one (lets call it "primary") is the main of the class and will be use 80% of the time. The second one (lets call ...
1
vote
4answers
276 views

Use the terms “vector” or “array” in high level discussion of C++ code

When I write high-level documentation about what an algorithm does, I use the term "array" to refer to the data structure on which the algorithm operates even though the actual data structure is an ...