Skip to main content

Questions tagged [standard-library]

For questions relating to designing and implementing standard library features

-4 votes
3 answers
211 views

Did C++'s std::forward_list really need insert_after, emplace_after, ...
Dannyu NDos's user avatar
  • 1,485
0 votes
1 answer
233 views

In the standard C++ library, some class templates lack definition, but are defined when their template is specialized. The most notable such class template is ...
Dannyu NDos's user avatar
  • 1,485
4 votes
0 answers
203 views

Local allocators can be beneficial in situations where tracking memory usage or releasing all allocated memory without running destructors at the end of an activity is possible. From that perspective, ...
feldentm's user avatar
  • 2,498
10 votes
5 answers
1k views

By "cases" I mean uppercase, lowercase, and titlecase. It seems many languages assumes that there is one-to-one correspondence of uppercase letters and lowercase letters, if the script that ...
Dannyu NDos's user avatar
  • 1,485
-1 votes
2 answers
562 views

In computer science, compare-and-swap is known as, well, "compare-and-swap" and often abbreviated as "CAS." Why are the functions in the standard C library and C++ library named <...
Paul J. Lucas's user avatar
3 votes
1 answer
263 views

I've checked the information on cppreference.com and found that there are only 2 and 3 input hypot function. I am wondering why not implement the variadic version ...
JimmyHu's user avatar
  • 165
9 votes
1 answer
2k views

Another design decision that baffled me. Checking if an element is in a set is the entire purpose of a set! Until C++20 I had to write stuff like ...
qwr's user avatar
  • 601
17 votes
3 answers
5k views

This is something that has slightly annoyed me for a while. A map as a mathematical object (function) is by default "unordered", and the same is for maps as a data structure AKA associative ...
qwr's user avatar
  • 601
3 votes
0 answers
145 views

I'm looking for a guide for implementing exceptions in a language with explicit memory management like C++. However, the language's type system and exception handling semantics are incompatible with C+...
feldentm's user avatar
  • 2,498
2 votes
1 answer
282 views

Contiguous arrays do not mix with lazy evaluation. That's why Haskell doesn't have contiguous arrays as a primitive type, and why even GHC has a poor API for them. As such, I sought for a workaround. ...
Dannyu NDos's user avatar
  • 1,485
3 votes
3 answers
3k views

The documentation on C++'s unordered_map::erase states: Removes specified elements from the container. The order of the remaining elements is preserved. (This ...
Luatic's user avatar
  • 390
13 votes
0 answers
900 views

Go's time formatting strings are uniquely idiosyncratic, and I have not seen any other language use this sort of system: It is based on the exact timestamp for ...
bigyihsuan's user avatar
  • 1,861
12 votes
9 answers
6k views

I’m trying to decide whether my language should provide signed or unsigned bytes, but I’m struggling to find a good reason to choose either side. Popular languages vary in their decision. For example, ...
feldentm's user avatar
  • 2,498
14 votes
12 answers
7k views

In common languages, sine produces an error, NaN, or exception when evaluated at infinity. For example, in Python: ...
Corbin's user avatar
  • 901
5 votes
3 answers
418 views

Given a new language, how best should we convert decimal to binary floating point? And please don't just say "use strtod(3)": The venerable C function supports a baroque variety of weird ...
Beth's user avatar
  • 153

15 30 50 per page