Questions tagged [standard-library]

The standard library contains core utilities provided by all implementations of the language.

The standard library contains core utilities provided by all implementations of the language.

The size and scope of the standard library varies between languages, some provide only a few basic components for such things as string handling and I/O, whereas others provide higher-level tools for a wide variety of tasks such as XML processing, networking and database access.

For questions about specific languages' standard libraries use this tag in conjunction with the tag for the language, or use the indicated tags for these languages:

677 questions
0
votes
2 answers

C++ Template class function as template parameter

What is the right way to implement a class that acts (as far the template part is concerned) like the priority queue of the standard template library, in the sense that I need to create a data structure (parametrized for the type with a normal…
Daniel
  • 141
  • 3
  • 14
0
votes
1 answer

Adding SequenceTypes not implemented in Swift's standard library

In the standard library of Swift the + operator is only overloaded with ExtensibleCollectionType and another type which definitely conforms to SequenceType: func +
Qbyte
  • 12,753
  • 4
  • 41
  • 57
0
votes
1 answer

What does File.exists? do in Ruby?

So I was looking through the Ruby standard library docs on how to read a file when I found File.exists?, with this fascinating and illuminating description: exists?(p1)   (A Google search turns up a similar amount of information) It's a real…
Nic
  • 6,211
  • 10
  • 46
  • 69
0
votes
0 answers

Providing Standard Library for embedded Python

I've successfully embedded Python in a multi-platform C++ project. This required linking to a libpython, which needs to be provided for each platform I'm targeting. For OSX it was easy, I just pulled it out of some homebrew folder. But I would like…
P i
  • 29,020
  • 36
  • 159
  • 267
0
votes
1 answer

Scala RegexParser calculator example right-associativity

Javadoc for the RegexParsers trait contains the following example: object Calculator extends RegexParsers { def number: Parser[Double] = """\d+(\.\d*)?""".r ^^ { _.toDouble } def factor: Parser[Double] = number | "(" ~> expr <~ ")" …
Kirill Dubovikov
  • 1,457
  • 2
  • 21
  • 41
0
votes
2 answers

Bug in density calculation std::piecewise_constant_distribution?

It seems that std::piecewise_constant_distribution computes the densities wrongly , at least with GCC and its standard library. According to http://www.cplusplus.com/reference/random/piecewise_constant_distribution/: The densities should be computed…
Gabriel
  • 8,990
  • 6
  • 57
  • 101
0
votes
4 answers

Functor compile time error

My code - #include #include #include #include using namespace std; #include "boost\numeric\ublas\matrix.hpp" typedef boost::numeric::ublas::matrix matrix; class FillMat{ public: FillMat(float…
The Vivandiere
  • 3,059
  • 3
  • 28
  • 50
0
votes
3 answers

Is There a Standard Algorithm to Iterate Over a Range?

I need to call a lambda with every int in a range. Is there a standard algorithm that does this? Ideally something equivalent: for(auto i = 13; i < 42; ++i)[](int i){/*do something*/}(i);
Jonathan Mee
  • 37,899
  • 23
  • 129
  • 288
0
votes
1 answer

Undefined reference to '_fdopen' when linking against bzip2 library

I'm new to compiling on linux, so I'm treading on somewhat unfamiliar territory. I'm using the G++ and GCC compilers on Ubuntu 14.04 . I'm trying to compile bzip2 (1.0.6) as a shared library and use it in another application. To build the shared…
Silverlan
  • 2,783
  • 3
  • 31
  • 66
0
votes
2 answers

Can I "see" Java Standard Libraries Offline

Well, I am using BlueJ. I know I can use them offline for sure. But would it be possible to see the Oracle documentation without Internet connection? Included Method summary and description. Something like this but offline…
Dimitar
  • 4,402
  • 4
  • 31
  • 47
0
votes
1 answer

Multiple keys to one value data structure (C)

I would like to be able to retrieve an address using either of a corresponding integer or a character in a dynamic, memory efficient way. I'm working with the standard library. What are some possible ways of going about this? I'm wondering if it's…
erythraios
  • 249
  • 1
  • 9
  • 21
0
votes
2 answers

Why does POSIX not define a mid-layer socket API?

I am looking at socket programming again. I get the details (well, I can copy them from various websites, and I know the code is enabling the Unix low-level procedures), but I don't get the POSIX logic and thinking in its API. Why have they not…
ivo Welch
  • 2,427
  • 2
  • 23
  • 31
0
votes
3 answers

Is there a cross-platform header in the standard library that provides access to the current time?

Probably a stupid question, but I couldn't find anything searching... Is there a standard header that allows me to fetch the current time? Otherwise is there some cross-platform alternative?
Nathan Osman
  • 71,149
  • 71
  • 256
  • 361
0
votes
2 answers

Why scanf() can't filter double quatation mark, although set format to [A-Za-z]

I am trying to extract only letter words except the other characters in the sentence. For this, I use two scanf() as bellow. scanf("%s", word); sscanf(word, "%[A-Za-z]", word); Problem is that, double quatation mark on is not removed, although I…
joejo
  • 111
  • 11
0
votes
2 answers

How to test the rust standard library?

I'd like to make some changes to my copy of the rust standard library, then run the tests in the source files I changed. I do not need to test the compiler itself. How can I do this without testing a lot of things I am not changing and do not care…
jbapple
  • 3,297
  • 1
  • 24
  • 38