standard-library

When is #include <new> library required in C++?

Hi, According to this reference entry for operator new ( http://www.cplusplus.com/reference/std/new/operator%20new/ ) : Global dynamic storage operator functions are special in the standard library: All three versions of operator new are declared in the global namespace, not in the std namespace. The first and second...

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? ...

Does Objective-C have a Standard Library?

Most somewhat modern programming languages have a standard library? It is my impression is that there isn't a decent sized standard library for Obj-C , rather that it relies mostly/all on Cocoa and that (plus people not wanting to use GNUstep) is why Obj-C is only used on macs)? Is this true/to what extent? Are there any standard obj-c...

How do the size standard libraries compare for different languages

Someone was recently raving about how great jQuery was and how it made javascript into a pleasure and also how the whole source code was so small(and one file). I looked it up on www.ohloh.net/ and it said it was about 30,000 lines of javascript, when I tired curl piped to wc it said about 5000 lines(strange discrepancy that, maybe tes...

What new Unicode functions are there in C++0x?

It has been mentioned in several sources that C++0x will include better language-level support for Unicode(including types and literals). If the language is going to add these new features, it's only natural to assume that the standard library will as well. However, I am currently unable to find any references to the new standard librar...

Force import module from Python standard library instead of PYTHONPATH default

I have a custom module in one of the directories in my PYTHONPATH with the same name as one of the standard library modules, so that when I import module_name, that module gets loaded. If I want to use the original standard library module, is there any way to force Python to import from the standard library rather than from the PYTHONPAT...

Why do ZeroMemory, etc. exist when there are memset, etc. already?

Why does ZeroMemory, and similar calls exist in the Windows API when there are memset and related calls in the C standard library already? Which ones should I call? I can guess the answer is "depends". On what? ...

What are the "standard framework" code that we should build?

We are in a situation whereby we have 4 developers with a bit of free time on our hands (talking about 3-4 weeks). Across our code base, for different projects, there are a number of framework-y type of code that is re-written for every new project that we start. Since we have some free time on our hands, I'm in the process of creating ...

Libraries for standard stuff (ie: cout, etc) *NEWBIE QUESTIONS* :)

Hello everyone. I was wondering about the standard C libraries that contain all the functions/definitions like abs(), cout streams, printf, etc. I'm familiar with the header files (stdio.h, cmath.h, time.h, etc etc) but there doesn't seem to be any corresponding .lib or .dll anywhere (ie. stdio.lib, time.dll, etc). Where is the actual...

What are the current challenges of the D programming language?

I'm wondering how mature and stable D is, and if it might be a good replacement for C/C++. I know that there are currently two standard libraries (Phobos and Tango), so I assume that there might be people trying to unify them. Additionally I heard some time ago that the languages has problems on the boundaries of GCed/non-GCed code. I ...

Is there an alternative to suppressing warnings for unreachable code in the xtree?

When using the std::map with types that use trivial, non-throwing, copy constructors, a compiler warning/error is thrown (warning level 4, release mode) for unreachable code in xtree. This is because the std::map has a try-catch in it that helps maintain the state of the tree in the case of an exception, but the compiler figures out that...

Make Xcode tell the compiler to not link to any library including the standard library?

Well, the title says it all: How can I make Xcode tell the compiler not to link? I am making a library which may not link to anything. Where can I set in the target's properties that it must not link to the standard library, as I can choose static or dynamic only, there is no not option. Can you help me, please? Thanks. ...

Why is pair, make_pair, and rel_ops all in the same include file?

I know the standard library has its warts (find me a language with a standard library that doesn't) but I've always wondered why they felt the need to stuff two seemingly unrelated pieces of code into an include named "utility." Was there once a reason for this? Did this library once contain more things that were deemed helpful or beca...

Are all functions in the c++ standard library required have external linkage?

So I've got an app which compiles fine on windows, linux and a few variations of unix. I recently decided to port it to OSX when I ran into a snag. I have a template which looks like this: template<int (&F)(int)> int safe_ctype(unsigned char c) { return F(c); } the idea being to prevent sign extension from crashing certain implementa...

May std::tuple_element double as a universal template argument retriever?

This question got me thinking. Sometimes it's useful to grab an actual argument from a class template specialization, if it fails to define a public typedef of the argument. In C++03 it's a sign of either bad template design, or contrary design intent, and not particularly common. But variadic templates make typedef coverage impossible, ...

Changing Java PriorityQueue to a Max PQ

The Priority Queue implementation in the Java standard library appears to be a min Priority Queue which I found somewhat confusing. In order to turn it into a max one I created a custom comparator object. Comparator<Integer> cmp = new Comparator<Integer>() { public int compare( Integer x, Integer y ) { return y - x; ...

why is my std::string being cut off?

I initialize a string as follows: std::string myString = "'The quick brown fox jumps over the lazy dog' is an English-language pangram (a phrase that contains all of the letters of the alphabet)"; and the myString ends up being cut off like this: 'The quick brown fox jumps over the lazy dog' is an English-language pangram (a p...

Is the Python standard library really standard?

Is the Python standard library standard in the sense that if Python is installed, then the standard library is installed too? The documentation reads For Unix-like operating systems Python is normally provided as a collection of packages, so it may be necessary to use the packaging tools provided with the operating system to obtain ...

Howto do reference to ints by name in Python

I want to have a a reference that reads as "whatever variable of name 'x' is pointing to" with ints so that it behaves as: >>> a = 1 >>> b = 2 >>> c = (a, b) >>> c (1, 2) >>> a = 3 >>> c (3, 2) I know I could do something similar with lists by doing: >>> a = [1] >>> b = [2] >>> c = (a, b) >>> c ([1], [2]) >>> a[0] = 3 >>> c ([3], [2]...

Python web programming with standard library

I want to write a simple python web application to provide a gui to a command line program (think of hg serve, for example). It would run locally only. I don't want it to have any external dependencies for an easier deployment, so python web programming in general wouldn't apply here How can it be done with a minimal hassle? Any pointe...